马良AI写作初始化仓库
This commit is contained in:
25
AINoval/lib/blocs/theme/theme_state.dart
Normal file
25
AINoval/lib/blocs/theme/theme_state.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ThemeState {
|
||||
final ThemeMode themeMode;
|
||||
final bool isLoading;
|
||||
|
||||
const ThemeState({
|
||||
required this.themeMode,
|
||||
this.isLoading = false,
|
||||
});
|
||||
|
||||
ThemeState copyWith({
|
||||
ThemeMode? themeMode,
|
||||
bool? isLoading,
|
||||
}) {
|
||||
return ThemeState(
|
||||
themeMode: themeMode ?? this.themeMode,
|
||||
isLoading: isLoading ?? this.isLoading,
|
||||
);
|
||||
}
|
||||
|
||||
bool get isDarkMode => themeMode == ThemeMode.dark;
|
||||
bool get isLightMode => themeMode == ThemeMode.light;
|
||||
bool get isSystemMode => themeMode == ThemeMode.system;
|
||||
}
|
||||
Reference in New Issue
Block a user