flutter: Rename loadProfile to loadSettings

And print info when loading settings.
This commit is contained in:
Calcitem 2021-04-05 01:12:02 +08:00
parent c70fb83132
commit 38ef069d5e
2 changed files with 6 additions and 2 deletions

View File

@ -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 {

View File

@ -131,7 +131,7 @@ class _SanmillAppState extends State<SanmillApp> {
@override
void initState() {
Chain.capture(() {
Config.loadProfile();
Config.loadSettings();
});
super.initState();
}