multi_app_flavor 0.0.1 copy "multi_app_flavor: ^0.0.1" to clipboard
multi_app_flavor: ^0.0.1 copied to clipboard

A dedicated Flutter package to manage multi-tenant applications (flavors) with custom configurations, themes, and modular entry points.

Multi App Flavor #

Pub Version License: MIT

A Flutter package to easily manage multi-tenant applications (Flavors) with support for custom configurations, themes, and assets per flavor.

Repository: https://github.com/kedirinesia/Multi-App-Flavor

Features #

  • Singleton Configuration: Easy access to current flavor state anywhere in the app.
  • Flavor Independent UI: Build unrelated UI components for different apps using FlavorBuilder.
  • Visual Indicator: FlavorBanner to show current environment (Dev/Staging) on top of the app.
  • Custom Values: Store API endpoints, API Keys, and other constants specific to a flavor.

Getting Started #

  1. Add dependency to pubspec.yaml:
dependencies:
  multi_app_flavor:
    path: ./ # or git/pub path
  1. Initialize FlavorConfig in your main.dart (create separate main files for each flavor):

lib/main_app1.dart

void main() {
  FlavorConfig(
    flavor: Flavor.app1,
    name: 'Application 1',
    color: Colors.blue,
    values: {
      'baseUrl': 'https://app1.com/api',
    },
  );
  runApp(MyApp());
}
  1. Use FlavorBuilder in your code:
FlavorBuilder(
  onApp1: (_) => App1Logo(),
  onApp2: (_) => App2Logo(),
  orElse: (_) => DefaultLogo(),
)

Running Flavors #

Run the specific target file:

flutter run -t lib/apps/app1/main.dart
flutter run -t lib/apps/app2/main.dart
1
likes
150
points
78
downloads

Publisher

verified publisherfulung.my.id

Weekly Downloads

A dedicated Flutter package to manage multi-tenant applications (flavors) with custom configurations, themes, and modular entry points.

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on multi_app_flavor