go_flavor 1.0.0 copy "go_flavor: ^1.0.0" to clipboard
go_flavor: ^1.0.0 copied to clipboard

A flutter module to resolve flavor dependency with UI and configuration

go_flavor #

A flutter module to resolve flavor dependency with UI and configuration #

There is a full article explaining each one of the following module: #

  1. Flavors
  2. Flavors in Dart
  3. Visually identifying each flavor
  4. Identifying device info with the Banner
  5. Flavors in Android
  6. Running flavors with the IDE
  7. Using flavor values

Example #

import 'package:go_flavor/src/go_flavor.dart';

void main() {
  FlavorConfig(
      flavor: Flavor.QA,
      color: Colors.deepPurpleAccent,
      values: FlavorValues(
          data: "Any tye of data and use anywhere in the app using 'FlavorConfig.instance.values' (optional)", message: "This is a demo application to show in dialog(optional)"));
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'GoFlavor Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return FlavorBanner(
      child: Scaffold(
        appBar: AppBar(
          title: Text('page title'),
        ),
        body: _body(),
      ),
    );
  }
}


5
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A flutter module to resolve flavor dependency with UI and configuration

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

cupertino_icons, device_info, flutter

More

Packages that depend on go_flavor