Line data Source code
1 : // Copyright 2023 The terCAD team. All rights reserved.
2 : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.
3 :
4 : import 'package:shared_preferences/shared_preferences.dart';
5 :
6 : class AppPreferences {
7 : static const String prefPrivacyPolicy = 'privacyPolicy';
8 : static const String prefDoEncrypt = 'doEncrypt';
9 : static const String prefAccount = 'account';
10 : static const String prefBudget = 'budget';
11 : static const String prefCurrency = 'currency';
12 : static const String prefTheme = 'themeMode';
13 : static const String prefLocale = 'localeMode';
14 : static const String prefDesign = 'localeDesign';
15 : static const String prefExpand = 'expand';
16 : static const String prefPeer = 'p2p_host';
17 : static const String prefP2P = 'p2p_spot';
18 : static const String prefZoom = 'zoom';
19 : static const String prefColor = 'color';
20 : static const String prefPalette = 'palette';
21 : static const String prefPaletteDark = 'palette_dark';
22 : static const String prefVersion = 'version';
23 : static const String prefWeekStartDay = 'weekStartDay';
24 : static const String prefMonthStartDay = 'monthStartDay';
25 : static const String prefPrivacyKey = 'privacyKey';
26 : static const String prefIsOTP = 'isOTP';
27 : static const String prefIsBio = 'isBio';
28 : static const String prefRecoveryKey = 'recoveryKey';
29 : static const String prefSortingKey = 'sortingKey';
30 : static const String prefBudgetPositive = 'budgetPositive';
31 : static const String prefFinTs = 'fints';
32 : static const String prefFinTsState = 'fintsState';
33 : static const String prefSimpleFin = 'simplefin';
34 : static const String prefSimpleFinAccess = 'simplefinAccess';
35 : static const String prefEnableBanking = 'enablebanking';
36 : static const String prefEnableBankingKey = 'enablebankingKey';
37 : static const String prefEnableBankingSession = 'enablebankingSession';
38 :
39 : static const String isActive = 'true';
40 : static const String isInactive = 'false';
41 :
42 8 : static late SharedPreferences pref;
43 :
44 5 : static Future<void> set(String key, String value) async {
45 10 : await pref.setString(key, value);
46 : }
47 :
48 2 : static Future<void> clear(String key) async {
49 4 : await pref.remove(key);
50 : }
51 :
52 8 : static String? get(String key) {
53 16 : return pref.getString(key);
54 : }
55 : }
|