This guide helps you set up your Flutter project using Mason CLI and apply a modern structure with bricks, dependencies, and flavors.
dart pub global activate mason_climkdir mason
cd mason
mason initbricks:
i18n:
path: D:/projects/bricks/i18n (replace with real path)
readme:
path: D:/projects/bricks/readme (replace with real path)
assets:
path: D:/projects/bricks/assets (replace with real path)
core:
path: D:/projects/bricks/core (replace with real path)
feature:
path: D:/projects/bricks/feature (replace with real path)mason getBelow is a list of default dependencies used in this project:
| Category | Package | Purpose |
|---|---|---|
| 🎨 UI & Animations | animate_doshimmer_animationloading_animation_widgetcarousel_sliderflutter_screenutilsmooth_page_indicatorflutter_staggered_animationstimeline_tile |
Animations, responsive UI, indicators, timelines |
| 🖼️ Media & Graphics | cached_network_imageflutter_svgflutter_svg_providerphoto_viewimage_pickermime |
Image loading, SVG rendering, zoom, picker |
| 🌍 Localization | easy_localization |
Multi-language support |
| ⚡ State Management | flutter_blocequatabledartz |
Bloc/Cubit, equality, functional helpers |
| 🌐 Networking & APIs | diopretty_dio_loggerhttphttp_parser |
HTTP client, interceptors, parsers |
| 🔥 Firebase & Notifications | firebase_corefirebase_messagingflutter_local_notifications |
Firebase services & push notifications |
| 📍 Location & Maps | locationgeocodinggoogle_maps_flutter |
GPS, geocoding, maps |
| 📡 Real-time | pusher_channels_flutter |
Real-time events |
| 💾 Storage & Database | hivehive_flutter |
Local storage |
| 🌐 Web & Browser | webview_flutterwebview_flutter_androidwebview_flutter_wkwebview |
WebView support |
| 🛠️ Utilities & Helpers | get_ituuidpathpath_providercryptoconnectivity_plusinternet_connection_checker_pluscountry_pickercustom_timertimeagourl_launcherbot_toastrenamechange_app_package_nameflutter_widget_from_htmlpinput |
Dependency injection, UUID, file utils, crypto, network, pickers, timers, URL launching, toasts, renaming |
mason make core -o .././libmason make feature -o .././lib/featuresmason make i18n -o ../i18nmason make assets -o ../assetsmason make readme -o ../assets:
- i18n/
- assets/
- assets/global_icon/
- assets/images/
- assets/svg/
fonts:
- family: fontName
fonts:
- asset: assets/fonts/fontName/fontName-Light.ttf
weight: 300
- asset: assets/fonts/fontName/fontName-Regular.ttf
weight: 400
- asset: assets/fonts/fontName/fontName-Medium.ttf
weight: 500
- asset: assets/fonts/fontName/fontName-Bold.ttf
weight: 600
flutter_assets:
assets_path: assets/
output_path: lib/core/images/
filename: app_images.dart
classname: AppImagesmason cache clear flavorDimensions += "default"
productFlavors {
create("development") {
dimension = "default"
resValue(type = "string", name = "app_name", value = "your app name")
applicationIdSuffix = ".dev"
}
create("production") {
dimension = "default"
resValue(type = "string", name = "app_name", value = "your app name")
}android:label="@string/app_name"mason make launch -o ../.vscode