Skip to content

wiktoriasobczyk/flutter_starter_tools

Repository files navigation

flutter_starter_tools

Example project to show some project setup tools posibilities

Getting Started

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 Configuration

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:

Prerequisites

  1. Install Homebrew: If you don't have Homebrew installed, you can find the installation steps here.

Installation Steps

  1. Install FVM via Homebrew:

    brew tap leoafarias/fvm
    brew install fvm
  2. Check Available Flutter Versions:

    fvm releases
  3. 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
  4. Activate Flutter Version for Your Project: Navigate to your project directory and set the version:

    fvm use stable

    or

    fvm use 3.10.6
  5. Update .gitignore File: Ensure that Flutter version-specific files aren't accidentally committed to your version control.

  6. Using Flutter Commands with FVM: All traditional Flutter commands can be prefixed with fvm:

    fvm flutter run

🌍 Flavors Configuration with flutter_flavorizr

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:

1️⃣ Install the Package

Add the following dependency to your pubspec.yaml file:

dependencies:
  flutter_flavorizr: ^latest_version

2️⃣ Define your flavors

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"

3️⃣ Invoke script

Run scirpt fvm flutter pub run flutter_flavorizr

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published