dynamic_config_generator 0.2.0
dynamic_config_generator: ^0.2.0 copied to clipboard

Dynamically generate config for a build variant using a json file

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:example/build_config.g.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Dynamic Config Generator Demo',
      theme: ThemeData(
        primarySwatch: Colors.pink,
      ),
      home: MyHomePage(title: 'Dynamic Config Generator Demo'),
    );
  }
}

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

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text("is_release = ${BuildConfig.IS_RELEASE}"),
            SizedBox(
              height: 20,
            ),
            Text("api_key = ${BuildConfig.API_KEY}"),
          ],
        ),
      ),
    );
  }
}
2
likes
80
pub points
52%
popularity

Dynamically generate config for a build variant using a json file

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

build

More

Packages that depend on dynamic_config_generator