main function

void main()

Implementation

void main() async {
  String filePath = 'lib/app/widgets.dart';
  String existingCode = await File(filePath).readAsString();

  String directoryPath = 'lib/widget_book';
  var result = collectFolderInfo(directoryPath);
  var code = generateCode(result, existingCode);
  // print(result);
  await File(filePath).writeAsString(code);  // Generate and write the new code to the file
  print('Code generation completed');
}