Complete refactoring SFM App Source Code

This commit is contained in:
anhtunz
2024-12-15 00:59:02 +07:00
parent caa73ca43c
commit 2e27d59278
247 changed files with 18390 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
class StringUtils {
StringUtils._init();
static StringUtils? _instance;
static StringUtils get instance => _instance ??= StringUtils._init();
List<InlineSpan> parseAddressFromMapAPI(String addressString) {
RegExp regex = RegExp(r'<span class="([^"]+)">([^<]+)</span>');
List<InlineSpan> textSpans = [];
Iterable<Match> matches = regex.allMatches(addressString);
for (Match match in matches) {
String cssClass = match.group(1)!;
String text = match.group(2)!;
if (cssClass == 'country-name') {
continue;
}
textSpans.add(
TextSpan(
text: text,
),
);
textSpans.add(
const TextSpan(text: ', '),
);
}
textSpans.removeLast();
return textSpans;
}
}