Files
GymLink_Flutter/lib/providers/main.dart
2024-05-12 13:43:30 +03:00

24 lines
603 B
Dart

import 'package:flutter/material.dart';
import 'package:gymlink_module_web/theme.dart';
class GymLinkProvider 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();
}
}