AngeloAvv / flutter_flavorizr

A flutter utility to easily create flavors in your flutter application
https://pub.dev/packages/flutter_flavorizr
MIT License
469 stars 85 forks source link

Avoid repeating configuration #253

Open tolotrasamuel opened 7 months ago

tolotrasamuel commented 7 months ago

Thank you for building this tool.

Is there a way to preventing repeating strings in the config file like this:

ide: idea

flavors:
  prod:
    app:
      name: "My App Prod"

    android:
      applicationId: "com.myapp.prod"
      icon: "assets/icon/transparent-icon_launch_app.png"
    ios:
      bundleId: "com.myapp.prod"
      icon: "assets/icon/transparent-icon_launch_app.png"

    macos:
      bundleId: "com.myapp.prod"
      icon: "assets/icon/transparent-icon_launch_app.png"

  dev:
    app:
      name: "My App Dev"

    android:
      applicationId: "com.myapp.dev"
      icon: "assets/icon/transparent-icon_launch_app.png"
    ios:
      bundleId: "com.myapp.dev"
      icon: "assets/icon/transparent-icon_launch_app.png"

    macos:
      bundleId: "com.myapp.dev"
      icon: "assets/icon/transparent-icon_launch_app.png"

  preprod:
    app:
      name: "My App Preprod"

    android:
      applicationId: "com.myapp.preprod"
      icon: "assets/icon/transparent-icon_launch_app.png"

    ios:
      bundleId: "com.myapp.preprod"
      icon: "assets/icon/transparent-icon_launch_app.png"

    macos:
      bundleId: "com.myapp.preprod"
      icon: "assets/icon/transparent-icon_launch_app.png"

I think the above is too repetitive. A nice way would be only overriding what changes

ide: idea
app:
  name: "My App Prod"
  buildFor: [android, ios, macos]
  icon: "assets/icon/transparent-icon_launch_app.png"
  android:
    icon: "assets/icon/transparent-icon_launch_android_app.png"

flavors:
  prod:
    app:
      id: "com.myapp.dev"
    macos:
      icon: "assets/icon/transparent-icon_launch_app_macos.png"

  dev:
    app:
      name: "My App Dev"
      id: "com.myapp.dev"

    ios:
      bundleId: "com.myapp.ios.dev"
      icon: "assets/icon/transparent-icon_launch_app_ios.png"

  preprod:
    app:
      name: "My App Preprod"
      id: "com.myapp.preprod"