getAppName method
Fetches the app name from the Android Manifest file. Returns: Future<String?>, the name of the application.
Implementation
@override
Future<String?> getAppName() async {
final filePath = androidManifestPath;
var contentLineByLine = await readFileAsLineByline(
filePath: filePath,
);
for (var i = 0; i < contentLineByLine.length; i++) {
if (contentLineByLine[i]?.contains('android:label=') ?? false) {
return (contentLineByLine[i] as String).split('"')[1].trim();
}
}
return null;
}