Add: gym themes

This commit is contained in:
2024-06-07 14:57:40 +03:00
parent 65c8f56e20
commit 04ee6d1699

View File

@@ -139,34 +139,28 @@ class _ExamplePageState extends State<ExamplePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('GymLink Example App'), title: const Text('GymLink Example App Gym 1'),
), ),
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
drawer: getDrawer(context), drawer: getDrawer(context),
body: Column( body: const Column(
children: [ children: [
const Text('test'), Text('test'),
IconButton( Expanded(
icon: const Icon(Icons.abc),
onPressed: () {
context.read<GymLinkProvider>().onTokenReceived('token123');
},
),
const Expanded(
child: MyApp(), child: MyApp(),
), ),
const SizedBox( SizedBox(
height: 20, height: 20,
), ),
const Text('Bottom text') Text('Bottom text')
], ],
), ),
floatingActionButton: IconButton( floatingActionButton: IconButton(
icon: const Icon(Icons.search), icon: const Icon(Icons.search),
onPressed: () { onPressed: () {
context context.read<GymLinkProvider>().changeTheme(
.read<GymLinkProvider>() Random().nextInt(0xffffff + 1),
.changeTheme(Random().nextInt(0xffffff + 1)); blackTheme: Random().nextBool());
}, },
), ),
); );
@@ -209,6 +203,7 @@ class _ExampleClub2PageState extends State<ExampleClub2Page> {
Future<void> _setToken() async { Future<void> _setToken() async {
final token = await getToken('a8622a61-3142-487e-8db8-b6aebd4f04aa', '123'); final token = await getToken('a8622a61-3142-487e-8db8-b6aebd4f04aa', '123');
context.read<GymLinkProvider>().changeTheme(0xFFAABCAB);
if (token != '') { if (token != '') {
context.read<GymLinkProvider>().onTokenReceived(token); context.read<GymLinkProvider>().onTokenReceived(token);
} else { } else {
@@ -220,34 +215,26 @@ class _ExampleClub2PageState extends State<ExampleClub2Page> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('GymLink Example App'), title: const Text('GymLink Example App Gym2'),
), ),
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
drawer: getDrawer(context), drawer: getDrawer(context),
body: Column( body: const Column(
children: [ children: [
const Text('test'), Text('test'),
IconButton( Expanded(
icon: const Icon(Icons.abc),
onPressed: () {
context.read<GymLinkProvider>().onTokenReceived('token123');
},
),
const Expanded(
child: MyApp(), child: MyApp(),
), ),
const SizedBox( SizedBox(
height: 20, height: 20,
), ),
const Text('Bottom text') Text('Bottom text')
], ],
), ),
floatingActionButton: IconButton( floatingActionButton: IconButton(
icon: const Icon(Icons.search), icon: const Icon(Icons.search),
onPressed: () { onPressed: () {
context // context.read<GymLinkProvider>().changeTheme(0xFFAABCAB);
.read<GymLinkProvider>()
.changeTheme(Random().nextInt(0xffffff + 1));
}, },
), ),
); );