scaling the timeline
This commit is contained in:
parent
c63f062640
commit
ee081de0ab
14 changed files with 202 additions and 63 deletions
|
@ -1,4 +1,7 @@
|
|||
import 'package:flutter/painting.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../global.dart' as global;
|
||||
|
||||
enum Settings {
|
||||
instanceUrl,
|
||||
|
@ -38,3 +41,20 @@ Future<String> loadAuthCode() async {
|
|||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
Future<bool> saveLocale(String locale) async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
return await prefs.setString("active-locale", locale);
|
||||
}
|
||||
|
||||
Future<Locale> loadLocale() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
String? locale = prefs.getString("active-locale");
|
||||
if (locale == null) {
|
||||
if (global.availableLocales.contains(Locale(Intl.systemLocale))) {
|
||||
return Locale(Intl.systemLocale);
|
||||
}
|
||||
return const Locale("en");
|
||||
}
|
||||
return Locale(locale);
|
||||
}
|
||||
|
|
1
lib/business_logic/timeline/timeline.dart
Normal file
1
lib/business_logic/timeline/timeline.dart
Normal file
|
@ -0,0 +1 @@
|
|||
|
Loading…
Add table
Add a link
Reference in a new issue