"Steal" theme from example app
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gymlink_module_web/main_mobile.dart';
|
import 'package:gymlink_module_web/pages/main.dart';
|
||||||
import 'package:gymlink_module_web/providers/main.dart';
|
import 'package:gymlink_module_web/providers/main.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@@ -23,6 +23,7 @@ class MyExampleApp extends StatelessWidget {
|
|||||||
builder: (context, provider, __) => const ExamplePage(),
|
builder: (context, provider, __) => const ExamplePage(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
theme: ThemeData.dark(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,13 +39,13 @@ class _ExamplePageState extends State<ExamplePage> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
context.read<GymLinkProvider>().onTokenReceived('token123');
|
Future.microtask(
|
||||||
|
() => context.read<GymLinkProvider>().onTokenReceived('token123'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Consumer<GymLinkProvider>(
|
return Scaffold(
|
||||||
builder: (context, provider, __) => Scaffold(
|
|
||||||
appBar: AppBar(title: const Text('GymLink Example App')),
|
appBar: AppBar(title: const Text('GymLink Example App')),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -52,11 +53,12 @@ class _ExamplePageState extends State<ExamplePage> {
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.abc),
|
icon: const Icon(Icons.abc),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
provider.onTokenReceived('token123');
|
context.read<GymLinkProvider>().onTokenReceived('token123');
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const Expanded(
|
Expanded(
|
||||||
child: MyApp(),
|
child:
|
||||||
|
MainPage(isLoading: context.watch<GymLinkProvider>().isLoading),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
@@ -67,10 +69,11 @@ class _ExamplePageState extends State<ExamplePage> {
|
|||||||
floatingActionButton: IconButton(
|
floatingActionButton: IconButton(
|
||||||
icon: const Icon(Icons.search),
|
icon: const Icon(Icons.search),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
provider.changeTheme(Random().nextInt(0xffffff + 1));
|
context
|
||||||
|
.read<GymLinkProvider>()
|
||||||
|
.changeTheme(Random().nextInt(0xffffff + 1));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user