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/herald/app_locale.dart';
5 : import 'package:app_finance/design/wrapper/text_wrapper.dart';
6 : import 'package:material_ui/material_ui.dart';
7 :
8 : class NumberWidget extends TextWrapper {
9 : final ColorScheme colorScheme;
10 :
11 2 : const NumberWidget(
12 : super.text, {
13 : super.key,
14 : required this.colorScheme,
15 : required super.style,
16 : super.tooltip,
17 : super.maxLines,
18 2 : }) : super();
19 :
20 2 : @override
21 4 : TextStyle? get style => super.style?.copyWith(
22 16 : color: text.characters.firstOrNull == '-' || text.contains(AppLocale.labels.spent)
23 8 : ? Color.alphaBlend(Colors.red.withValues(alpha: 0.4), colorScheme.secondary)
24 : : null,
25 : );
26 : }
|