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:
Create a new repo using this template.
Clone your new repo.
Install Melos globally executing: dart pub global activate melos
.
test: melos -v
note: if your terminal don't recognize melos command, you can add the following line to your .zshrc or .bashrc file:
export PATH="$PATH":"$HOME/.pub-cache/bin"
Run melos doctor
.
Run melos pub:get
.
Setup Android:
flutter.versionName=1.0.0
flutter.appId=base
flutter.versionCode=1
flutter.compileSdkVersion=33
flutter.minSdkVersion=21
flutter.targetSdkVersion=33
Android SignIn
keytool -genkey -v -keystore ~/keystore_name.jks -keyalg RSA -keysize 2048 -validity 10000 -alias your_alias"
storePassword=<YourStorePassword>
keyPassword=<YourKeyPassword>
keyAlias=<YourStoreAlias>>
storeFile=<FilePath>
{
"API_URL": "https://dummyjson.com"
}
FLUTTER_APP_ID=base.debug
FLUTTER_APP_NAME=RS Base Debug
Follow the Android Studio instructions to setup the editor
Follow the VS Code instructions to setup the editor
Note: Starting with Flutter 2.8 in order for you to launch the app in Android you must
define the flutter.compileSdkVersion
inside the local.properties
file.
You can read more about this here.
.../lib/main/env/main_dev.dart
{
"API_URL": "https://dummyjson.com"
}
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
/lib/main/env/main_dev.dart
Include any additional run argments to launch the app.
Environment variables
Add the env vars for each flavor with the property toolArgs
Inside the Run and Debug section select the environment you want to excute
Make sure you have the device you want to use already open
Run the App
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.
Build your android appBundle or apk:
flutter build appBundle -t lib/main/env/main.dart --dart-define-from-file=env_prod.json
[TODO: add how to setup Xcode for apple signIn]
Configure your iOs app sigIn.
flutter build ipa --release -t lib/main/env/main.dart --dart-define-from-file=env_prod.json
For more information you can check the docs
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.
TBD
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.