What to keep, what to change, and what to delete when starting a new project from this template.
Start with melos run init (project-initialization.md): it applies the project identity
everywhere. This page covers what comes after.
| Category | What | Guidance |
|---|---|---|
| Base infrastructure (keep) | Package layout and dependency direction; XInit DI pattern; ResultType/Resource/Failure; BaseCubit, ListBlocState, CancelableCubitMixin; NetworkConfig + AuthTokenInterceptor; Preferences; AppCubit (theme/lang); Routes enum + go_router shells; LocalTheme/ThemeColors scaffolding; intl setup; platform/permission abstractions; the pub workspace + Melos scripts (root pubspec.yaml); .fvmrc; coverage/full_coverage.py |
Preserve these. Change them only through an architecture decision, and upstream improvements to the template. |
| Extension points (customize) | ThemeColors palettes (light_theme_colors.dart, dark_theme_colors.dart); LocalTheme text styles + fonts; Dimen; Images enum; .arb files; AnalyticsClient implementation; PermissionManager methods; Preferences keys; NetworkConstants; AuthTokenInterceptor header/clear policy; FlavorValues (empty, for per-flavor values); TrackedPage |
Designed to be filled in per project. |
| Example / reference (replace) | Auth flow (AuthRepositoryImpl is a fake that sleeps and stores 'new-token'), login/sign-up pages, onboarding (4 placeholder pages), home, splash, /app/placeholder route, User model, cookies banner, EnvironmentSelector, DebugBanner |
They show the patterns. Rewrite them against your real backend and design, keeping the same shape. |
| Placeholders (must replace) | See the checklist below | Leaving any of these in production is a defect. |
| Generated (never hand-edit) | app/lib/presentation/resources/locale/generated/**; Flutter plugin registrants; ios/Flutter/Generated.xcconfig; flutter_base.json (the initializer's) |
Regenerate them instead. |
| Protected boundaries | Dependency rules in modules.md; interfaces in domain / impls in data; Common → Data → Domain init order | Changing these needs an explicit decision. |
- Run
melos run init. It sets the app name, Dart package name, Android application ID and namespace (and movesMainActivity.kt), the iOS bundle ID and display names, web titles,appName, and the Sonar project key and name. Don't edit those by hand. The full list is in project-initialization.md. - Package descriptions ("A new Flutter project." / "A new Flutter package project.") and the template
README.md/CHANGELOG.mdin eachmodules/*. - License:
app/LICENSE.md,modules/*/LICENSE(MIT). Replace or remove them for private projects (the README says so).
- Decide on one env scheme and fix the drift described in overview.md § Environments
and known-issues #2.
EnvConfig.apiUrlaccepts eitherAPI_URL_<FLAVOR>orAPI_URL. Pick one layout and document it. - Create env files per flavor, and don't commit real secrets. Everything in
app/env/is bundled into the app as an asset.SECRET_KEYinenv/.devis a placeholder. - Check the iOS flavor targets (
FLUTTER_TARGETinios/Flutter/*.xcconfig,ios/dev.xcconfig,ios/qa.xcconfig) if you add or rename entrypoints. - Android product flavors (if you need them). None exist today.
-
NetworkConstants: timeouts (2 s is aggressive),tokenHeader("token"), and the exampleproductsPath/baseUrl.
- Palettes in
themes/resources/*_theme_colors.dart(currently the Material 3 baseline purple), andborderRadiusinapp_themes.dart. - Fonts (
app/fonts/,pubspec.yamlfonts:, and the family names inLocalTheme). - App icons (
android/app/src/main/res/mipmap-*,ios/Runner/Assets.xcassets/AppIcon.appiconset), launch screens, andweb/icons. -
Images.appLogopoints toassets/icons/logo.png, which doesn't exist. Add the asset and apubspec.yamlentry.
- Firebase: uncomment and fill in
Firebase.initializeAppinmain.dart,main_dev.dart, andmain_qa.dart, and add the platform config files (google-services.json/GoogleService-Info.plist, which are git-ignored inapp/.gitignore). - Analytics: implement
AnalyticsClient(for example, finishFirebaseAnalytics), register it in GetIt, callSetupAnalytics.initialize(), and addrouteObservertoGoRouter(observers: [...]). - Auth: replace
AuthRepositoryImplwith real API calls, and checkAuthTokenInterceptor's "clear everything on 401/403/422" policy. - Deep links:
app_linksis wired for the initial link, but there's no Android intent filter or iOS associated domains config. Add them per platform.
- Android: create a keystore and
android/key.properties(git-ignored).build.gradlereadsstoreFile,storePassword,keyAlias, andkeyPassword. - iOS: signing team and provisioning profiles in Xcode. None are committed, and the README marks this as TODO.
- Versioning:
version:inapp/pubspec.yamlis the single source for Android and iOS. Bump it there, or pass--build-name/--build-numbertoflutter build.
-
ci.yml(format, analyze, test, Android build) needs no setup. - SonarQube starts running once the project is initialized. Add the repository secrets
SONAR_TOKENandSONAR_URL(andSSH_PRIVATE_KEYonly if you add git-based pub dependencies).sonar-project.propertiesgets its key and name frominit. - Bump the Flutter version with
fvm use <version>and commit.fvmrc. CI follows it. - iOS isn't built in CI. Add a macOS job if the project needs it.
-
.github/pull_request_template.md: adjust the issue-tracker link.
- Remove or replace the example pages and strings you don't need (onboarding copy, "Sorry we didn't find any product", terms hint).
- Remove the
/app/placeholderroute. - Remove the unused dependencies you don't adopt (see known-issues #13).