fix : some ui and

This commit is contained in:
2025-09-23 11:18:33 +03:30
parent e176671812
commit 884b4f1556
21 changed files with 271 additions and 101 deletions

View File

@@ -0,0 +1,24 @@
import 'package:flutter/services.dart';
class FirstDigitDecimalFormatter extends TextInputFormatter {
@override
TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
String digit = newValue.text.replaceAll(RegExp(r'[^0-9]'), "");
late String res;
if (digit.isEmpty) {
return newValue.copyWith(text: '');
}
if (digit.length == 1) {
res = digit;
} else {
res = '${digit[0]}.${digit.substring(1)}';
}
return TextEditingValue(
text: res,
selection: TextSelection.collapsed(offset: res.length),
);
}
}

View File

@@ -14,3 +14,4 @@ export 'number_utils.dart';
export 'parser.dart';
export 'route_utils.dart';
export 'separator_input_formatter.dart';
export 'first_digit_decimal_formatter.dart';