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