Flutter base is a boilerplate project created by Rootstrap for new projects using Flutter. The main objective is helping any new projects jump start into feature development by providing a handful of functionalities.
This template comes with:
- Dependency injection (GetIt).
- HttpClient already configured for Rootstrap BE Projects(Dio).
- Theming setup.
- Intl.
- State Management (Blocs/Cubit).
- Env config and flavors.
- Create a new repo using this template.
- Clone your new repo.
- Run
flutter doctor
. - Run
flutter pub get
.
-
Follow the Android Studio instructions to setup the editor
-
Follow the VS Code instructions to setup the editor
- Open a Simulator or Emulator
- Open your project in your editor of preference
- Add a Run Configuration
- Add new Flutter configuration
- Give it a meaningful name IE: Dev, QA, Staging, Prod
- Pick the entry point, main.dart file location IE:
.../lib/main/env/main_dev.dart
- Include any additional run arguments to launch the app, IE: Environment Variables.
- Select the device to launch the App
- Run the App
- Go to Run and Debug section at the Activity Bar
- At the top of the section expand the list and Add Configuration
- Insert Flutter Launch configuration
- Update the environment name (dev)
- Update the launch program path
/lib/main/env/main_dev.dart
- Update the Flutter Mode (debug, profile, release)
Note 1: Create as much Launch Configurations as you need for any specific environment.
Note 2: You shouldn't commit the .vscode/launch.json
file.
For more information you can check the docs
- intl and intl_utils for localization.
- flutter_svg Svg Image loader.
- [dart_code_metrics] (https://dartcodemetrics.dev/docs/rules) Dart code static analysis code.
In order to meet the required code quality standards, this project is following this tech guides considerations. It also runs flutter analyze for each build on your CI/CD tool.
We strongly recommend that all private keys should be saved as ENV Vars on each platform. Our
Flavors config already manages this. In Android Studio, add the env var for each flavor:
Android: Go to android -> app -> build.gradle
and add your env var name like this:
def dartEnvironmentVariables = [
YOUR_DEV_API_KEY: null
]
iOS: No extra configuration needed.
We are using Bitrise to configure and run the CI/CD pipelines.
Flutter-Base is available under the MIT license. See the LICENSE file for more info.
NOTE: Remove the free LICENSE file for private projects or replace it with the corresponding license.
Flutter Base is maintained by Rootstrap with the help of our contributors.