mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
WIP isar theme class
This commit is contained in:
parent
c832bc2f54
commit
3db3ad06c5
1 changed files with 29 additions and 0 deletions
29
lib/models/isar/sw_theme.dart
Normal file
29
lib/models/isar/sw_theme.dart
Normal file
|
@ -0,0 +1,29 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
|
||||
@Collection(inheritance: false)
|
||||
class SWTheme {
|
||||
/// should be a uuid
|
||||
@Index(unique: true, replace: true)
|
||||
final String id;
|
||||
|
||||
/// the theme name that will be displayed in app
|
||||
final String name;
|
||||
|
||||
// system brightness
|
||||
final String brightnessString;
|
||||
|
||||
/// convenience enum conversion for stored [brightnessString]
|
||||
@ignore
|
||||
Brightness get brightness {
|
||||
switch (brightnessString) {
|
||||
case "light":
|
||||
return Brightness.light;
|
||||
case "dark":
|
||||
return Brightness.dark;
|
||||
default:
|
||||
// just return light instead of a possible crash causing error
|
||||
return Brightness.light;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue