mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 19:16:44 +08:00
@@ -4,21 +4,20 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
|
||||
enum ThemeType {
|
||||
light('浅色'),
|
||||
dark('深色'),
|
||||
system('跟随系统'),
|
||||
;
|
||||
system('跟随系统');
|
||||
|
||||
final String desc;
|
||||
const ThemeType(this.desc);
|
||||
|
||||
ThemeMode get toThemeMode => switch (this) {
|
||||
ThemeType.light => ThemeMode.light,
|
||||
ThemeType.dark => ThemeMode.dark,
|
||||
ThemeType.system => ThemeMode.system,
|
||||
};
|
||||
ThemeType.light => ThemeMode.light,
|
||||
ThemeType.dark => ThemeMode.dark,
|
||||
ThemeType.system => ThemeMode.system,
|
||||
};
|
||||
|
||||
Icon get icon => switch (this) {
|
||||
ThemeType.light => const Icon(MdiIcons.weatherSunny, size: 24),
|
||||
ThemeType.dark => const Icon(MdiIcons.weatherNight, size: 24),
|
||||
ThemeType.system => const Icon(MdiIcons.themeLightDark, size: 24),
|
||||
};
|
||||
ThemeType.light => const Icon(MdiIcons.weatherSunny, size: 24),
|
||||
ThemeType.dark => const Icon(MdiIcons.weatherNight, size: 24),
|
||||
ThemeType.system => const Icon(MdiIcons.themeLightDark, size: 24),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user