widget_generator 1.0.0+1
widget_generator: ^1.0.0+1 copied to clipboard
A powerful and flexible CLI tool for generating Dart code snippets and templates with ease. Ideal for streamlining repetitive tasks, such as creating UI components, boilerplate code, and more in both [...]
example/widget_generator_example.dart
import 'dart:io';
import '../bin/widget_generator.dart';
Future<void> main() async {
print('\nWelcome to a code snippet generator 🚀');
while (true) {
print('1: Button');
print('2: Login Screen');
print('3: Exit');
stdout.write(
'Select a snippet to generate: ',
);
String? choice = stdin.readLineSync();
switch (choice) {
case '1':
await buttonMenu();
break;
case '2':
await chooseDirectoryAndGenerateSnippet('login screen');
break;
case '3':
print('Exiting.');
return;
default:
print('Invalid choice. Please select 1, 2, or 3.');
}
}
}