mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
add homepage
This commit is contained in:
20
lib/base/theme.dart
Normal file
20
lib/base/theme.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
var themeProvider = ChangeNotifierProvider((ref) => ThemeViewModel());
|
||||
|
||||
class ThemeViewModel extends ChangeNotifier {
|
||||
ThemeData currentTheme = lightTheme;
|
||||
|
||||
void changeTheme() {
|
||||
if (currentTheme == darkTheme) {
|
||||
currentTheme = lightTheme;
|
||||
} else {
|
||||
currentTheme = darkTheme;
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
ThemeData darkTheme = ThemeData.dark().copyWith();
|
||||
ThemeData lightTheme = ThemeData.light().copyWith();
|
||||
Reference in New Issue
Block a user