Say My Frame
Say My Frame (SMF) generates Flutter apps from independent modules. You choose what the app needs, such as a router, tabs at the bottom, dependency injection, a state manager, Firebase services or screens, and smf create generates a Flutter project in which these pieces already work together. The routes of the screens are in the router, the tabs show the screens, the services are registered in the container, and the start-up code runs in the right order.
dart pub global activate smf_flutter_cli
smf create my_app -m home,bottom_tabs,get_it,bloc
The same modules, picked by answering the questions of smf create in a terminal.
What you get is a regular Flutter project. It does not depend on SMF at run time, and nothing in it has to be generated again, so the code is yours from the first commit.
Why modules
A module is one piece of an app, such as the router or the analytics, and modules do not know about each other. A module that shows screens says that it needs a router, without knowing that the router is go_router. The analytics module can follow the screens the user sees when the app has a router, whichever router it is. SMF calls these shared parts roles, and more than one module can provide the same role.
That is why any combination works: you can add or leave out a module, or swap one provider of a role for another, and the app still compiles. Continuous integration generates apps from the modules in many combinations and checks each one with flutter analyze.
The modules
| Role | Modules that provide it | How many in an app |
|---|---|---|
| App entry | flutter_core | always one |
| Router | go_router | none or one |
| Layout | bottom_tabs | none or one |
| State management | bloc, riverpod | none or one |
| Dependency injection | get_it | none or one |
| Events | event_bus | none or one |
| Crash reporting | firebase_crashlytics | any number |
| Analytics | firebase_analytics | any number |
Two modules provide no role: the feature home, a start screen, and firebase_core, which sets up Firebase for the other Firebase modules.
Status
SMF generates apps for Flutter 3.44 or newer and Dart 3.12 or newer. It is tested on macOS, Linux and Windows.
Where to go next
- To generate an app, install SMF, create your first app and take a tour of it.
- To pick modules, read Choosing modules and the
smf createreference. - To see how it works, read about the module model and the generation pipeline.
- To write a module of your own, start with Extending SMF.
- To help build SMF, see Contributing.