Open source · Mason brick
Flutter Starter
flutter_starter_template-
One command
A Mason brick that turns flutter create into a production-ready app for phones, tablets and desktops.
mason make flutter_app_template -
Four layers, one direction
Every feature is data → domain → presentation on a shared core: BLoC with freezed states, get_it, and a Result that is either success or failure.
lib/features/showcase_feed/ -
A real design system
Tokens for spacing, radii, durations and states, light and dark schemes, the Tajawal font, 55 Lucide icons and 20+ ds/ widgets.
lib/common/widgets/ds/ -
Skeletons and motion
One layout for loading and loaded (.loading() / .success()) with a synced sweep, and a motion kit — scroll reveal, count-up, glint, Ken Burns, parallax — all finite and aware of reduced motion.
class FeedCard extends SkeletonWidget -
A request’s journey
Bloc → repository → data source → Dio’s interceptors in order: mock, offline cache, memory, JWT, language, log, error. With USE_MOCK=true the first one answers from assets/mock and the screen fills in.
flutter run --dart-define=USE_MOCK=true -
A first frame that’s right
A colour-only native splash hands over to an in-app splash on the same colour; theme and language are restored before the first frame, the first tab loads behind the splash, and the shell — not the splash — asks for notifications.
bootstrap() -
One layout for every screen
Five window size classes, read every frame: the floating capsule on phones, an 80dp rail on tablets and sideways phones, a collapsible 256dp sidebar from 840dp; the feed grid goes 1 → 2 → 3 columns and sheets become dialogs.
docs/RESPONSIVE.md -
Windows and macOS too
The same code on the desktop: a custom title bar in the app’s colours, the window restored where it was, shortcuts, hover and context menus, and free installers — setup.exe, MSIX and .dmg.
flutter run -d windows -
Routes and sign-in
An AppPage tree on one stack with Android predictive back; LinkDispatcher opens links over the shell; loginRequired or guestFirst, and the login wall offers “Continue as guest”.
AppNavigator.push -
Arabic first, English too
A first launch opens in Arabic and light; the strings generator refuses missing keys and turns Arabic’s six plural forms into typed methods; every layout mirrors.
dart run tool/generate_app_strings.dart -
A feature in one command
Data source, model, mapper, repository, facade, a bloc with freezed states, a screen with every state and a SkeletonWidget card — and with --mock, its fixtures.
dart run tool/generate_feature.dart orders --mock -
Two apps, shared packages
Need two apps? The companion monorepo keeps what they share in four packages — common, core, utils, features — and /port-from-brick carries every change of this brick over to it.
packages/acme/{common,core,utils,features} -
410+ tests
Bloc, widget and golden tests with the real font, size classes, the side navigation, adaptive sheets, shortcuts, height parity, theme contrast, route guard and a boot test.
flutter test -
Ready to ship, with Claude Code
A release APK of 11.6 MB instead of 74.5, Windows and macOS installers, Codemagic — and a CLAUDE.md with skills (/first-run, /new-feature, /release, /finish) so the work carries on in the same style.
dart run tool/build_release_apk.dart
Flutter Starter
Inside the repository
-
The brick, from the outside
Everything mason make writes into a new app: 496 files — the app in lib/, its tests, assets, docs, the tools, and the rules that teach AI assistants the architecture.
mason make flutter_app_template -
lib/ — the app itself
263 files in four folders — core (the plumbing), common (the shared UI), features and utils — next to main.dart, bootstrap.dart and app.dart.
lib/ -
core/ — the plumbing
84 files, one folder per app-wide concern: services, notifications, theme, network, layout, router, shortcuts, config, injection, errors and the desktop window.
lib/core/ -
network/ — one Dio client
dio_client.dart, the API config and endpoints, the interceptors and an offline response cache.
lib/core/network/dio_client.dart -
One interceptor per file
The mock interceptor answers first; then the memory guard, the language headers and the error mapper — the same chain the starter story follows.
mock_interceptor.dart -
layout/ — every screen size
app_breakpoints.dart turns the window width into size classes: a capsule bar on phones, a rail from 600 dp, a sidebar from 840 dp — read anywhere through layout_reader.dart.
lib/core/layout/app_breakpoints.dart -
notification/ — 11 files
Local notifications out of the box, FCM behind one flag, the permission asked from the shell, a coordinator, time zones and a push-token registrar.
notification_coordinator.dart -
ds/ — the design system
29 widgets every screen is built from: cards, chips, badges, the peek carousel, the skeleton, the motion kit, the top bar, the status banner…
lib/common/widgets/ds/ -
A feature, from the inside
data → domain → presentation: the feed’s data and entities, its Blocs with freezed states, a preloader, the screens and their widgets.
lib/features/showcase_feed/ -
auth/ — signing in
A data source, a repository and a facade; the Bloc; the login screen, the sign-in sheet for guest-first apps and the session-expired banner.
auth_gate_sheet.dart -
test/ — 97 files
Bloc, widget and golden tests: features, the shared UI, core, the translations, helpers and the tools — 410+ tests on the adaptive branch.
flutter test -
tool/ — the generators
generate_feature.dart builds a whole feature in one command; the strings generator, setup_project.dart, and the release builders for Android, Windows and macOS.
dart run tool/generate_feature.dart -
All of it, from one command
496 files, every one shown here — and all of them yours the moment mason make finishes.
mason make flutter_app_template --on-conflict overwrite
A Mason brick that turns flutter create into a production-ready app skeleton: BLoC clean architecture, a real design system with skeleton loading and a motion kit, a mock-data layer, deep links, Arabic and English, and 290+ tests.
- My role
- Author & maintainer
- Period
- 2025 – Present
- Company
- Open source
- Runs on
- Android · iOS · Windows · macOS
Read the whole case study · 1 min
A Mason brick that turns flutter create into a production-ready app skeleton: BLoC clean architecture, a real design system with skeleton loading and a motion kit, a mock-data layer, deep links, Arabic and English, and 290+ tests.