getAppName method
Fetches the app name from the Web index.html file.
Returns: Future<String?>, the app name if found, null otherwise.
Implementation
@override
Future<String?> getAppName() async {
final filePath = webIndexPath;
var contentLineByLine = await readFileAsLineByline(
filePath: filePath,
);
for (var i = 0; i < contentLineByLine.length; i++) {
if (contentLineByLine[i]?.contains('<title>') ?? false) {
var match =
RegExp(r'<title>(.*?)</title>').firstMatch(contentLineByLine[i]!);
return match?.group(1)?.trim();
}
}
return null;
}