chore: Migrate wrong datatype for fontSizeFactor
This commit is contained in:
parent
fb29b4c54e
commit
8cf46f0a7f
1 changed files with 15 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:async/async.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
|
@ -72,6 +73,20 @@ enum AppSettings<T> {
|
||||||
|
|
||||||
final store = AppSettings._store = await SharedPreferences.getInstance();
|
final store = AppSettings._store = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
|
// Migrate wrong datatype for fontSizeFactor
|
||||||
|
final fontSizeFactorString =
|
||||||
|
Result(() => store.getString(AppSettings.fontSizeFactor.key))
|
||||||
|
.asValue
|
||||||
|
?.value;
|
||||||
|
if (fontSizeFactorString != null) {
|
||||||
|
Logs().i('Migrate wrong datatype for fontSizeFactor!');
|
||||||
|
await store.remove(AppSettings.fontSizeFactor.key);
|
||||||
|
final fontSizeFactor = double.tryParse(fontSizeFactorString);
|
||||||
|
if (fontSizeFactor != null) {
|
||||||
|
await store.setDouble(AppSettings.fontSizeFactor.key, fontSizeFactor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (store.getBool(AppSettings.sendOnEnter.key) == null) {
|
if (store.getBool(AppSettings.sendOnEnter.key) == null) {
|
||||||
await store.setBool(AppSettings.sendOnEnter.key, !PlatformInfos.isMobile);
|
await store.setBool(AppSettings.sendOnEnter.key, !PlatformInfos.isMobile);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue