flutter_core
| Package | Kind | Provides the role | Needs | Choose with |
|---|---|---|---|---|
smf_flutter_core | scaffold | App entry | nothing | added to every app |
flutter_core creates the Flutter app that every SMF app starts from: the Android and iOS projects, main(), the start-up sequence, the root widget and pubspec.yaml. It provides the app entry role, and every app needs exactly one provider of that role, so smf create adds flutter_core to every app.
What it adds to the app
| File | What it holds |
|---|---|
lib/main.dart | main(): WidgetsFlutterBinding.ensureInitialized(), await bootstrap(), then runApp() with the root widget inside the wrappers of other modules. |
lib/bootstrap.dart | bootstrap(), where the other modules put their start-up code, phase by phase. It imports neither material nor cupertino. |
lib/app.dart | App, the root widget: a MaterialApp.router with the router's configuration when the app has a router, or else a MaterialApp that shows the fallback start screen. Its builder holds the widgets that other modules put around the content of every route. |
lib/core/app/fallback_start_screen.dart | FallbackStartScreen, a screen with the name of the app, for an app without a screen to start on. |
test/core/app/fallback_start_screen_test.dart | A widget test of the fallback start screen. |
pubspec.yaml | The dependencies of all modules, with Dart ^3.12.0 and Flutter >=3.44.0, and flutter_lints for the lints. |
analysis_options.yaml | The lints of a new Flutter app, with build/** left out of the analysis. |
README.md | The name of the app, and the sections that other modules add. |
.gitignore, .metadata | The files of the same names that flutter create writes. |
android/, ios/ | The projects of flutter create of Flutter 3.44, with the identifiers of the app. |
The native projects are those that flutter create --platforms=android,ios writes with Flutter 3.44.2, with a few changes:
- The names and identifiers come from the app. The Android label and the iOS display name are the name of the app in title case. The Android namespace, application id and Kotlin package path, and the iOS bundle id, come from
--organd the app name. - The minimum iOS version is 15.0, the lowest that Xcode 27 builds for, unless a module needs a higher one. The Xcode project has no development team.
- The Android manifest,
Info.plistand the Gradle files have places where other modules add permissions, keys and plugins.
Start-up phases
bootstrap() runs the start-up code that modules and roles add, in four phases, in this order:
| Phase | What goes there |
|---|---|
| early | Code that must come before anything else |
| platform | Platform services, such as await Firebase.initializeApp(...) and installCrashReporting() |
| DI | The services of the app: await registerDependencies(); |
| late | Code that needs those services |
main() runs the root widget inside the wrappers that modules add, such as the ProviderScope of Riverpod.
Choosing it
You never choose it. Every app has it, and smf create adds it by itself.
Requirements
The app needs Flutter 3.44 or newer and Dart 3.12 or newer, and runs on iOS 15 or newer. For iOS builds with Xcode 27, see troubleshooting.