mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 10:29:06 +02:00
Added environment example
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -326,6 +326,38 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// Environment
|
||||||
|
Card(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"Environment",
|
||||||
|
style: Theme.of(context).textTheme.headlineSmall,
|
||||||
|
),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
final Environment currentEnvironment =
|
||||||
|
ArcaneEnvironment.of(context).environment;
|
||||||
|
if (currentEnvironment == Environment.normal) {
|
||||||
|
ArcaneEnvironment.of(context).enableDebugMode();
|
||||||
|
} else {
|
||||||
|
ArcaneEnvironment.of(context).disableDebugMode();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: const Text("Switch environment"),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"Environment: ${ArcaneEnvironment.of(context).environment.name}",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user