Improved json auto save & budget mobile UI
This commit is contained in:
19
lib/repositories/metadata/models/settings.dart
Normal file
19
lib/repositories/metadata/models/settings.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Settings {
|
||||
final ThemeMode themeMode;
|
||||
|
||||
const Settings({
|
||||
this.themeMode = ThemeMode.system,
|
||||
});
|
||||
|
||||
factory Settings.fromJson(Map<String, dynamic> json) {
|
||||
return Settings(
|
||||
themeMode: ThemeMode.values.byName(json['themeMode']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, String> toJson() => {
|
||||
'themeMode': themeMode.name,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user