Mobile example app

This commit is contained in:
2024-05-12 13:42:05 +03:00
parent 75bfc7ea6b
commit 6c4c2c4acd
4 changed files with 109 additions and 25 deletions

23
lib/providers/main.dart Normal file
View File

@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';
import 'package:gymlink_module_web/theme.dart';
class ModuleMethods with ChangeNotifier {
bool _isLoading = true;
bool get isLoading => _isLoading;
bool _blackTheme = false;
bool get blackTheme => _blackTheme;
ThemeData _theme = myTheme;
ThemeData get theme => _theme;
void onTokenReceived(String token) {
if (token == 'token123') {
_isLoading = false;
notifyListeners();
}
}
void changeTheme(int color) {
_blackTheme = !_blackTheme;
_theme = getThemeData(Color(color), _blackTheme);
notifyListeners();
}
}