A scalable boilerplate for flutter apps.
- Create your own
.env.production
and.env.development
files. - You'll need your own
google-services.json
andGoogleServices-info.plist?
files from firebase.
- A layered architecture
- BLoC pattern via flutter_bloc
- Routing via Fluro (Deeplinking supported)
- ENV variables via envify
- TextStyle management
- Firebase Analytics
- Firebase Messaging
- Android
- iOS
- Themes
- Common Components
- Button
- Alerts
- Progress Indicators
- Bottom Sheets
- Fluid transitions between components
- JSON Serialization
- Define the route in routes.dart
- Handle the route in handlers.dart
- Use Application singleton's
navigateTo
method for navigation. i.e.App.navigateTo()
instead ofApp.router.navigateTo()
. - Can be used for deeplinking.
- Define
.env.production
and.env.development
in the root of the project. - Run
flutter pub run build_runner build
after creation and every change made to the env files. - Add the ENV variables in both the
.env
files and then the abstraction class. - ENV variables can then be accessed after importing the environment file.
For example:
Env.key
- No need to pass context to display the toast alerts.
- Use
App.notifySuccess(message)
to display a success message. - Use
App.notifyWarning(message)
to display a warning message. - Use
App.notifyError(message)
to display a error message. - You can customize these toasts in the app.dart file.
- All the font styles i.e.
TextStyle
should be maintained in thecore/presentation/common/fonts
directory. - A font family will translate to being the
primary
,secondary
or thetertiary
font in the project. - Each font family must have it's own separate file which follows the conventions laid out in primary_font.dart.
- Use quicktype.io to create the model classes. Go to the website, select
dart
and paste the JSON respone.
- Both foreground and background messages are handled in firebase.dart.
- Add your
google-services.json
andGoogleServices-info.plist
files. This repo does not contain either. - Check out the JSON structure at the bottom of firebase.dart file that needs to be followed for Heads-up notifications on background messages (Android).