A new Flutter project.
- Authentication with Firebase
- BLoC architecture
- Internationalization
- Environmnetalized application
- Navigation
The application is environmentalized.
All the values that can be different per envionment are housed in environment.dart
Currently, there are three environments added, development and production.
Follow this guide and get credentials for Android and iOS.
- Change the package of the project from
com.flutter.mobiletoyour.package.com - Change the name of the application from
flutter_mobile_applicationtoyour_application_name - Create a Firebase project in console.
- Add
androidandiosapps - Replace
google-services.jsonpresent in/android/app/google-services.jsonwith the one you created - Replace
GoogleService-Info.plistpresent in/ios/Runner/GoogleService-Info.plistwith the one you created - Once replaced, build the app and the app should be able to interact with Firebase.
Make sure everything is installed by running
flutter doctor
- Run an emulator
- Run
flutter run lib/main_developement.dart. This will run the app with developement env variables.
- Flutter
- Awesome Flutter Snippets
- Flutter Intl
You can add confugurations in the run section for the various evironments:
{
"configurations": [
{
"name": "Dev",
"type": "dart",
"request": "launch",
"program": "lib/main_development.dart"
},
{
"name": "Prod",
"type": "dart",
"request": "launch",
"program": "lib/main_production.dart"
}
]
}json_serializable and json_annotation is used to generate code for JSON serialization and deserialization.
*.g.dart file is generate per model class that has all the generated code.
- Add a model under a
modelsfolder in afeaturepackage. - annotate with
json_annotationsas shown in this example - Run
flutter pub run build_runner build. The generated files will be placed in the same folder as the original model. - DO NOT EDIT the
*.g.dartfiles manually. Any subsequent build will replace the manually edited files.
You might see some errors but it can be ignored.
Default language,
enis already added.
intl_utils is used to generate contents for the app.
Content is generated from intl_<lang>.arb files in l10n.
Content classes are generates in compile time and used to refer the content strings. A generated folder contains all the content.
To generate content
- Add
intl_<lang>.arbunder l10n folder. - Run
flutter pub run intl_utils:generateto generate content classes for the languages. - Make sure to add the files in
vcs - DO NOT EDIT the content files manually. Any subsequent build will replace the manually edited files.
flutter clean
flutter build apk --release lib/main_development.dartflutter clean
flutter build apk --release lib/main_production.dart.
├── assets
│ └── images
└── lib
├── app
├── common
│ ├── bloc
│ │ └── connectivity
│ ├── constants
│ ├── network
│ ├── routes
│ ├── styles
│ └── widgets
├── features
│ ├── authentication
│ │ ├── bloc
│ │ └── repository
│ ├── landing
│ │ └── ui
│ ├── main
│ │ ├── bloc
│ │ ├── models
│ │ ├── pages
│ │ │ ├── account
│ │ │ │ ├── bloc
│ │ │ │ ├── repositories
│ │ │ │ └── ui
│ │ │ │ └── widgets
│ │ │ ├── feed
│ │ │ │ └── ui
│ │ │ ├── home
│ │ │ │ └── ui
│ │ │ └── notification
│ │ │ └── ui
│ │ ├── repositories
│ │ └── ui
│ │ └── widgets
│ ├── signin
│ │ ├── bloc
│ │ ├── respositories
│ │ └── ui
│ │ └── widgets
│ └── signup
│ ├── bloc
│ ├── respositories
│ └── ui
│ └── widgets
├── generated
│ └── intl
└── l10n




