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 prefAkahu = 'akahu';
32 : static const String prefAkahuTokens = 'akahuTokens';
33 : static const String prefFinTs = 'fints';
34 : static const String prefFinTsState = 'fintsState';
35 : static const String prefSimpleFin = 'simplefin';
36 : static const String prefSimpleFinAccess = 'simplefinAccess';
37 : static const String prefEnableBanking = 'enablebanking';
38 : static const String prefEnableBankingKey = 'enablebankingKey';
39 : static const String prefEnableBankingSession = 'enablebankingSession';
40 : static const String prefTeller = 'teller';
41 : static const String prefTellerCertificate = 'tellerCertificate';
42 : static const String prefTellerKey = 'tellerKey';
43 : static const String prefTellerEnrollments = 'tellerEnrollments';
44 : static const String prefStarling = 'starling';
45 : static const String prefStarlingToken = 'starlingToken';
46 : static const String prefUp = 'upBanking';
47 : static const String prefUpToken = 'upBankingToken';
48 : static const String prefWise = 'wise';
49 : static const String prefWiseToken = 'wiseToken';
50 : static const String prefInvestec = 'investec';
51 : static const String prefInvestecCredentials = 'investecCredentials';
52 : static const String prefPrivatBank = 'privatbank';
53 : static const String prefPrivatBankToken = 'privatbankToken';
54 : static const String prefMonobank = 'monobank';
55 : static const String prefMonobankToken = 'monobankToken';
56 : static const String prefMonzo = 'monzo';
57 : static const String prefMonzoSecret = 'monzoSecret';
58 : static const String prefMonzoTokens = 'monzoTokens';
59 : static const String prefNotification = 'notificationParser';
60 :
61 : static const String isActive = 'true';
62 : static const String isInactive = 'false';
63 :
64 9 : static late SharedPreferences pref;
65 :
66 6 : static Future<void> set(String key, String value) async {
67 12 : await pref.setString(key, value);
68 : }
69 :
70 1 : static Future<void> clear(String key) async {
71 2 : await pref.remove(key);
72 : }
73 :
74 9 : static String? get(String key) {
75 18 : return pref.getString(key);
76 : }
77 : }
|