Flutter Base Project
Clone using copy_template
dart pub global activate copy_template
copy_template <project_name> https://github.com/dannndi/flutter_my_app <path>or
dart pub global activate copy_template
copy_template ./script/setup.sh- all remaining "com.company.myapp" to "your.bundle.id"
- all "my_app" to your "package_name"
- Copy
config.json.exampletoconfig.json
Getting started
./script/setup.shSimple build runner
./script/build_runner.shCreate module
./script/gen_module.shGenerate translation
./script/gen_translate.shAppEventBroadcaster allows you to broadcast events across your app, from any page, widget, or function, and listen to them anywhere.
AppEventBroadcaster.I.push(MyEvent());final sub = AppEventBroadcaster.I.listen((event) {
print('Received event: $event');
});
// Later, cancel when done
sub.cancel();handleRequest allows you to call APIs safely, automatically handling network errors and returning a FutureResult<T> (Either<Failure, T>).
Note: The API response JSON must follow this format:
{
"status": 200,
"message": "Success",
"payload": { /* your data here, e.g., object or list */ }
}// Call API
final result = await handleRequest(
execute: () async => apiService.getBanners(),
);
// Handle result
result.fold(
(failure) => print('Error: ${failure.message}'),
(banners) => print('Got ${banners.length} banners'),
);