LCOV - code coverage report
Current view: top level - lib/_classes/herald - app_palette.dart Coverage Total Hit
Test: lcov.info Lines: 15.4 % 13 2
Test Date: 2026-11-14 15:04:37 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:app_finance/_classes/storage/app_preferences.dart';
       5              : import 'package:app_finance/_configs/custom_color_scheme.dart';
       6              : import 'package:material_ui/material_ui.dart';
       7              : 
       8              : class AppPalette extends ValueNotifier<String> {
       9           12 :   static get state => AppPreferences.get(AppPreferences.prefColor) ?? AppColors.colorApp;
      10            0 :   static get light => AppPreferences.get(AppPreferences.prefPalette) ?? AppDefaultColors().toString();
      11            0 :   static get dark => AppPreferences.get(AppPreferences.prefPaletteDark) ?? AppDarkColors().toString();
      12              : 
      13           18 :   AppPalette() : super(state);
      14              : 
      15            0 :   Future<void> setMode(String newValue) async {
      16            0 :     if (newValue != value) {
      17            0 :       value = newValue;
      18            0 :       await AppPreferences.set(AppPreferences.prefColor, value);
      19            0 :       notifyListeners();
      20              :     }
      21              :   }
      22              : 
      23            0 :   Future<void> set(AppDefaultColors light, AppDefaultColors dark) async {
      24            0 :     await AppPreferences.set(AppPreferences.prefPalette, light.toString());
      25            0 :     await AppPreferences.set(AppPreferences.prefPaletteDark, dark.toString());
      26            0 :     notifyListeners();
      27              :   }
      28              : }
        

Generated by: LCOV version 2.0-1