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 : 24 4 : static late SharedPreferences pref; 25 : 26 3 : static Future<void> set(String key, String value) async { 27 6 : await pref.setString(key, value); 28 : } 29 : 30 0 : static Future<void> clear(String key) async { 31 0 : await pref.remove(key); 32 : } 33 : 34 4 : static String? get(String key) { 35 8 : return pref.getString(key); 36 : } 37 : }