writeMap function
dynamic
writeMap()
Implementation
writeMap() async {
File f = File("lib/app/screens.dart");
String content =
"""\n/*\n *\t\n@Author Champlain Marius Bakop\n@Email champlainmarius20@gmail.com\n@github ChamplainLeCode */\n\n\nList<Map<Symbol, dynamic>> screens = [\n""";
generatedScreens.forEach((String annotation, Map<Symbol, dynamic> data) {
if (data[#initial])
content =
"""import '${data[#uri]}';\n$content\n\t{#name: '$annotation', #screen: () => ${data[#className]}, #initial: ${data[#initial]}},""";
else
content =
"""import '${data[#uri]}';\n$content\n\t{#name: '$annotation', #screen: () => ${data[#className]}},""";
});
content = "$content\n\n];";
await f.writeAsString(content, mode: FileMode.write);
}