mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-09-13 06:33:00 +08:00
24 lines
699 B
Dart
24 lines
699 B
Dart
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
class Settings {
|
|
// singleton
|
|
static final Settings _singleton = Settings._internal();
|
|
factory Settings() => _singleton;
|
|
Settings._internal();
|
|
static Settings get instance => _singleton;
|
|
|
|
void load(SharedPreferences pref) {
|
|
gitAuthor = pref.getString("gitAuthor") ?? gitAuthor;
|
|
gitAuthorEmail = pref.getString("gitAuthorEmail") ?? gitAuthorEmail;
|
|
}
|
|
|
|
Future save() async {
|
|
var pref = await SharedPreferences.getInstance();
|
|
pref.setString("gitAuthor", gitAuthor);
|
|
pref.setString("gitAuthorEmail", gitAuthorEmail);
|
|
}
|
|
|
|
String gitAuthor = "GitJournal";
|
|
String gitAuthorEmail = "app@gitjournal.io";
|
|
}
|