LCOV - code coverage report
Current view: top level - _classes/storage - app_preferences.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 5 7 71.4 %
Date: 2024-10-04 11:08:31 Functions: 0 0 -

          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           5 :   static late SharedPreferences pref;
      25             : 
      26           2 :   static Future<void> set(String key, String value) async {
      27           4 :     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           5 :   static String? get(String key) {
      35           9 :     return pref.getString(key);
      36             :   }
      37             : }

Generated by: LCOV version 1.14