flutter: Rename loadProfile to loadSettings
And print info when loading settings.
This commit is contained in:
parent
c70fb83132
commit
38ef069d5e
|
@ -61,7 +61,9 @@ class Config {
|
|||
static bool mayFly = true;
|
||||
static int maxStepsLedToDraw = 50;
|
||||
|
||||
static Future<void> loadProfile() async {
|
||||
static Future<void> loadSettings() async {
|
||||
print("Loading settings...");
|
||||
|
||||
final settings = await Settings.instance();
|
||||
|
||||
Config.toneEnabled = settings['ToneEnabled'] ?? true;
|
||||
|
@ -120,6 +122,8 @@ class Config {
|
|||
rule.mayFly = Config.mayFly = settings['MayFly'] ?? true;
|
||||
rule.maxStepsLedToDraw =
|
||||
Config.maxStepsLedToDraw = settings['MaxStepsLedToDraw'] ?? 50;
|
||||
|
||||
print("Loading settings done!");
|
||||
}
|
||||
|
||||
static Future<bool> save() async {
|
||||
|
|
|
@ -131,7 +131,7 @@ class _SanmillAppState extends State<SanmillApp> {
|
|||
@override
|
||||
void initState() {
|
||||
Chain.capture(() {
|
||||
Config.loadProfile();
|
||||
Config.loadSettings();
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue