svgToRegionList method
Implementation
Future<List<Region>> svgToRegionList(String svgAddress) async {
final svgMain = await rootBundle.loadString(svgAddress);
List<Region> regionList = [];
final regExp = RegExp(Constants.mapRegexp,
multiLine: true, caseSensitive: false, dotAll: false);
regExp.allMatches(svgMain).forEach((regionData) {
final region = Region(
id: regionData.group(1)!,
name: regionData.group(2)!,
path: parseSvgPath(regionData.group(3)!));
sizeController.addBounds(region.path.getBounds());
regionList.add(region);
});
return regionList;
}