Skip to main content

Create your first app

smf create generates an app in a new directory. In a terminal it asks what it needs to know, and with the answers given as options it asks nothing.

Answer the questions​

Run smf create in the directory where the app's own directory should go:

smf create

This is what a run looks like when you pick the start screen home, tabs at the bottom, get_it and the event bus:

👋 Hello! Let's create a Flutter app with Say My Frame.
? App name my_app
? Organization (reverse domain) com.example
? Features: which do you want? home — Start screen with the name of the app
? Infrastructure: which do you want? none
? Layout: which module provides it? bottom_tabs — Tabs in a bar at the bottom of the app
? State management: which module provides it? None
? Dependency injection: which module provides it? get_it — Service locator with get_it
? Events: which module provides it? event_bus — Event bus with event_bus
? Crash reporting: which module provides it? none
? Analytics: which module provides it? none
✓ Checking the machine (12ms)
Adding flutter_core: the only provider of the app entry role, which every app needs.
Adding go_router: the only provider of the router role, which home requires.
✓ Rendering the app (88ms)
✓ Getting the packages of the app (1.0s)
✓ Cleaning up the imports (2.4s)
✓ Applying dart fix (0.7s)
✓ Formatting the code (0.3s)
✓ Getting the packages of the app in its directory (0.6s)
Created my_app in /Users/you/projects/my_app.
Run it:
cd /Users/you/projects/my_app
flutter run

A short note with links to the community follows.

The questions​

QuestionWhat the answer does
App nameThe default is my_app. The name becomes the Dart package name of the app in snake_case, so My App becomes my_app, and it names the app's directory.
OrganizationReverse domain notation, com.example by default. It starts the identifiers of the app: com.example.my_app on Android and com.example.my-app on iOS, where bundle identifiers take no underscores.
Features, InfrastructureThese list the modules that provide no role, grouped by their kind. Select any number of them, or none.
One question per roleEach lists the modules that provide the role, such as the layout or dependency injection. A role that an app has at most one of also offers None. For crash reporting and analytics you can select several modules, or none.

A role that the modules you picked require offers no None. When only one module provides it, SMF adds that module without asking and tells you why. Here the start screen requires a router, so SMF adds go_router. The layout requires the router too, which is why SMF asks about the layout first.

Use the arrow keys to move, the space bar to select in a list that takes several answers, and Enter to confirm. Ctrl-C cancels the run at any question and leaves nothing behind.

What happens next​

After the questions, SMF renders the app in memory and writes it to a temporary directory. There it gets the packages with flutter pub get, runs the setup steps of the modules, cleans up the imports, applies dart fix and formats the code. Then it moves the app to its directory and gets the packages again, because Flutter writes the path of the app into some files. If flutter pub get or a step that the app cannot do without fails, the app stays in the temporary directory, and the error says where. A step that the app can do without, such as flutterfire configure, is left for later with its command instead, and a failure of dart fix or dart format is only a warning.

Pass everything as options​

You can give every answer on the command line instead. This command generates the same app without asking anything:

smf create my_app --org com.example -m home,bottom_tabs,get_it,event_bus --no-input
  • -m lists the modules, separated by commas. SMF adds what they need, such as the router for home.
  • --org sets the organization. Without it, the organization is com.example.
  • --no-input turns the questions off. A run that would have to ask stops with an error that names the option to add.

A run without a terminal, as in a script or in CI, asks nothing either. See the smf create reference for every option.

Run the app​

cd my_app
flutter run

The app opens on the start screen, with the name of the app in its app bar. The tab bar stays hidden while the app has a single screen, since there is nothing to switch to yet.

For iOS builds with Xcode 27 and Flutter 3.44, see troubleshooting.

Next​

Take a tour of the app to see what each module added.