Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lohanidamodar/flutter_flavors
Flutter flavors tutorial
https://github.com/lohanidamodar/flutter_flavors
flutter flutter-examples flutter-flavors flutter-tutorials
Last synced: 18 days ago
JSON representation
Flutter flavors tutorial
- Host: GitHub
- URL: https://github.com/lohanidamodar/flutter_flavors
- Owner: lohanidamodar
- Created: 2019-04-12T15:32:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-11T10:08:33.000Z (over 5 years ago)
- Last Synced: 2024-11-29T21:44:01.621Z (about 1 month ago)
- Topics: flutter, flutter-examples, flutter-flavors, flutter-tutorials
- Language: Dart
- Homepage:
- Size: 71.3 KB
- Stars: 33
- Watchers: 2
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flutter Flavors
Separating build environments in flutterThis is a companion repository for my youtube tutorial regarding flutter flavors. This consists of a 3 part tutorial.
### [Companion Tutorial Videos ](https://www.youtube.com/watch?v=DgGUtTUatDQ&list=PLUiueC0kTFqLdkuj4j8FNy1qlzcI0nyCu)
## Part 1
- Starting code is in [master](https://github.com/lohanidamodar/flutter_flavors/tree/master) branch.
- Final code is in [part1](https://github.com/lohanidamodar/flutter_flavors/tree/part1) branchIn this part, we will learn to separate build environment and configs in dart side, we will learn to create separate main files each for the build flavors we want and apply different configs to each app.
## Part 2
- Starting code is in [part2-start](https://github.com/lohanidamodar/flutter_flavors/tree/part2-start) branch.
- Final code is in [part2-finish](https://github.com/lohanidamodar/flutter_flavors/tree/part2-finish) branchIn part 2 we will learn to setup flavors in android side which will allow us to use two separate firebase configs based on flavors in our flutter project in android.
## Part 3
- Starting code is in [part3-start](https://github.com/lohanidamodar/flutter_flavors/tree/part3-start) branch.
- Final code is in [part3-finish](https://github.com/lohanidamodar/flutter_flavors/tree/part3-finish) branchIn part 3 we will learn to setup schemas in iOS side, and make our flutter app able to use separate firebase config in iOS.
### Run Script phase code
```bash
if [ "${CONFIGURATION}" == "Debug-prod" ] || [ "${CONFIGURATION}" == "Release-prod" ] || [ "${CONFIGURATION}" == "Release" ]; then
cp -r "${PROJECT_DIR}/Runner/Firebase/prod/GoogleService-Info.plist" "${PROJECT_DIR}/Runner/GoogleService-Info.plist"echo "Production plist copied"
elif [ "${CONFIGURATION}" == "Debug-dev" ] || [ "${CONFIGURATION}" == "Release-dev" ] || [ "${CONFIGURATION}" == "Debug" ]; then
cp -r "${PROJECT_DIR}/Runner/Firebase/dev/GoogleService-Info.plist" "${PROJECT_DIR}/Runner/GoogleService-Info.plist"
echo "Development plist copied"
fi
```