Example project to show some project setup tools posibilities
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
FVM stands for Flutter Version Management. It's a tool that simplifies the process of switching between different Flutter versions in your projects. Let's get it set up:
- Install Homebrew: If you don't have Homebrew installed, you can find the installation steps here.
-
Install FVM via Homebrew:
brew tap leoafarias/fvm brew install fvm
-
Check Available Flutter Versions:
fvm releases
-
Install Desired Flutter Version: You can choose to install the stable version or any specific version:
fvm install stable
or
fvm install 3.10.6
-
Activate Flutter Version for Your Project: Navigate to your project directory and set the version:
fvm use stable
or
fvm use 3.10.6
-
Update
.gitignore
File: Ensure that Flutter version-specific files aren't accidentally committed to your version control. -
Using Flutter Commands with FVM: All traditional Flutter commands can be prefixed with
fvm
:fvm flutter run
Setting up different build variants or flavors allows you to manage multiple versions of the app (like development, staging, production) with unique configurations, icons, and even backend settings. The flutter_flavorizr
package simplifies this process in Flutter. Here's a guide to get you started:
Add the following dependency to your pubspec.yaml
file:
dependencies:
flutter_flavorizr: ^latest_version
In the pubspec.yaml
file, define the structure for your flavors. Each flavor can have distinct configurations for Android and iOS, MacOS and windows platform, allowing for granular control over aspects such as icons, firebase configurations, and more.
Below is an example configuration for two flavors: dev and prod.
flavorizr:
flavors:
dev:
app:
name: "My App Dev"
android:
applicationId: "com.myapp.dev"
icon: "path_to_dev_icon.png"
firebase:
config: "path_to_dev_firebase_config.json"
ios:
bundleId: "com.myapp.dev"
icon: "path_to_dev_icon.png"
firebase:
config: "path_to_dev_firebase_config.json"
macos:
bundleId: "com.myapp.dev"
icon: "path_to_dev_icon.png"
firebase:
config: "path_to_dev_firebase_config.json"
# Simple config bundle id for prod environment
prod:
app:
name: "My App Prod"
android:
applicationId: "com.myapp.prod"
ios:
bundleId: "com.myapp.prod"
Run scirpt fvm flutter pub run flutter_flavorizr