Mobile and web versions

This commit is contained in:
2024-05-10 19:50:33 +03:00
parent 9d92dfd145
commit 4853f61da2
8 changed files with 317 additions and 255 deletions

35
lib/states/mobile.dart Normal file
View File

@@ -0,0 +1,35 @@
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/theme.dart';
class MyAppStateMobile extends State<MyApp> {
bool _isLoading = true;
ThemeData theme = myTheme;
bool black_theme = false;
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'GymLink Module',
theme: theme,
debugShowCheckedModeBanner: false,
home: MainPage(isLoading: _isLoading),
);
}
void onTokenReceived(String token) {
if (token == 'token123') {
setState(() {
_isLoading = false;
});
}
}
void changeColor(int color) {
setState(() {
black_theme = !black_theme; //FIXME: TEMPORARY
theme = getThemeData(Color(color), black_theme);
});
}
}