Utilizing Flutter flavor feature combined with environmental variables to create two slightly different apps with a single codebase.
Step 1:
Download or clone this repo by using the command below:
git clone https://github.com/azeunkn0wn/flutter_flavor_concept.git
Step 2:
Go to project root and execute the following command in console to get the required dependencies:
flutter pub get
Step 3:
Create environment directory and .env
files.
- env
- meetyoda
- .env.development
- .env.production
- myvcmo
- .env.development
- .env.production
- meetyoda
Refer to the .env.example
for the content of each .env
files.
flutter run --flavor meetyoda -t lib/main_meetyoda.dart
flutter run --release --flavor meetyoda -t lib/main_meetyoda.dart
flutter run --flavor myvcmo -t lib/main_meetyoda.dart
flutter run --release --flavor myvcmo -t lib/main_meetyoda.dart