dynamic_config_generator 0.4.0 dynamic_config_generator: ^0.4.0 copied to clipboard
Dynamically generate config for a build variant using a json file
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({required this.title});
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.isRelease}"),
SizedBox(height: 20),
Text("api_key = ${BuildConfig.apiKey}"),
],
),
),
);
}
}