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 and the onboarding, tabs at the bottom, a settings screen, the localization, the theme, 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 a welcome and the next steps, onboarding β€” Onboarding on the first launch 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
? Settings screen: which module provides it? settings β€” Settings screen with the settings of the modules
? Localization: which module provides it? gen_l10n β€” Texts in ARB files with gen-l10n of Flutter
? Theme: which module provides it? material_theme β€” Light and dark Material 3 themes with a palette and a bundled font
? Dependency injection: which module provides it? get_it β€” Service locator with get_it
? State management: which module provides it? None
? 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
? Authentication: 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.
Adding shared_preferences: the only provider of the preferences role, which onboarding 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 may ask one more question once the modules are known. With the feature sign_in, or another module that brings the authentication, smf create asks who may use the app without an account: nobody, everyone, or everyone as an anonymous user. See Sign-in.

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 and the settings screen require the router too, which is why SMF asks about them first. The onboarding, the theme and the localization require the preferences, which remember what the user chose. Only shared_preferences provides them, so SMF adds it without a question here.

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,onboarding,bottom_tabs,settings,gen_l10n,material_theme,get_it,event_bus --no-input
  • -m lists the modules, separated by commas, in the order of the answers above. 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

On its first launch, the app shows the onboarding: two pages, with Skip above them and Next below. Skip, or Get started on the last page, ends it, and the app opens on the start screen. That screen greets you, names the app and lists three next steps, the first of which is to replace it with a screen of your own. At the bottom are two tabs, Home and Settings. Under Settings, the user chooses the language, English or Ukrainian, and the theme mode, and the app remembers both. The next launch opens on the start screen right away.

A walk through an app with these screens, recorded on an iPhone simulator. Its modules were chosen in another order, so its settings screen has Theme above Language.

An app with no screen to start on, such as an app without a feature, opens on the fallback start screen, which names the app and tells you where its first screen goes. With gen_l10n, such an app is in English and in Ukrainian too.

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.
  • To give the app sign-in, add sign_in and a state manager to -m, as in -m home,sign_in,bloc,bottom_tabs. Such an app signs in with Firebase Authentication, so it needs a Firebase project before it runs; see Sign-in.