Thank you for taking the time to visit my github website.
- This is my π: https://profile-summary-for-github.com/user/hnvn
- Mail me π«: [email protected]
A Flutter package provides some implementations of TextInputFormatter that format input with pre-defined patterns
License: BSD 3-Clause "New" or "Revised" License
Thank you for taking the time to visit my github website.
Not sure if relevant but I'm using a Locale where decimal separators are ,
eg: 12.345,67
Steps to reproduce:
ThousandsFormatter(allowFraction: true)
input formatter.12345,67
which renders as 12.345,67
,
Expected:
12345,67
Actual:
0,
As it happens, I needed to do some other formatting and I fixed this by adding a formatter before ThousandsFormatter, which makes sure that a second ,
is not possible to type.
Because every version of pattern_formatter depends on intl ^0.15.7 and every version of flutter_localizations from sdk depends on intl 0.16.0, pattern_formatter is incompatible with flutter_localizations from sdk.
So, because localize depends on both flutter_localizations any from sdk and pattern_formatter ^0.0.3, version solving failed.
pub get failed (1; So, because localize depends on both flutter_localizations any from sdk and pattern_formatter ^0.0.3, version solving failed.)
As this package uses intl: 0.16.0 and Flutter v2 uses 0.17.0 we cannot upgrade until this package constraints on intl allow 0.17.0
Because pattern_formatter 1.0.2 depends on intl ^0.16.0 and no versions of pattern_formatter match >1.0.2 <2.0.0, pattern_formatter ^1.0.2 requires intl ^0.16.0.
So, because my_app depends on both intl ^0.17.0 and pattern_formatter ^1.0.2, version solving failed.
Hi, can you please add support for time formatter in the HH:mm format?
I tested with Spanish and the ThousandsFormatter still uses commas for thousands and a period for the decimal separator.
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
locale: Locale("es", "ES"),
supportedLocales: [
Locale("en", "US"),
Locale("es", "ES"),
],
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
}
}
For example, could limit to two. Currently, it seems to stop at three digits.
How to modify the format, for example, change 01/01/2019 to 2019-01-01 or 2019/01/01
Update in pubspec.yaml
here my code:
inputFormatters: <TextInputFormatter>[ ThousandsFormatter( allowFraction: true, formatter: NumberFormat.decimalPattern("vi_VN")), LengthLimitingTextInputFormatter(15), ],
An exception is thrown if the date value is set through WidgetTest.
testWidgets(
'Test Case: test date validator.',
(WidgetTester tester) async {
await app.main();
await tester.pumpAndSettle();
// Set a date to a text field.
await tester.enterText(find.byKey(ValueKey<String>('key')), '01/01/2002');
// tap Submit button here
});
Null check operator used on a null value
When the exception was thrown, this was the stack:
#0 DateInputFormatter.formatEditUpdate (package:pattern_formatter/date_formatter.dart:82:32)
...
...
date_formatter.dart:82:32
final splashes = resultText!.replaceAll(RegExp(r'[^/]'), '');
Just testing this out.
Formatting is great, yet when I go to validate and make sure the number is int I get the error message
Invalid radix-10 number (at character 1)
I am calling
if (int.parse(value) >
to validate the value, so it looks like parse is not liking the value
Here is my validator
validator: (value) {
if (value.isEmpty) {
return 'Please enter an amount.';
}
if (int.parse(value) >
20) {
return 'Please enter a lower amount. The max you can request is ' +
20)
.toString();
}
return null;
},
Please, let me know if you still interessed in to maintain this package. Otherwise I'm considering to provide another updated version in the pub.dev.
I want to perform a number like that -1,234.56
When using the ThousandsFormatter(allowFraction: true)
and you try to enter a zero in the decimal section it does not allow it.
Does not allow the following zeros in the decimal section:
3,500.01
3,500.10
Any thoughts to make it work?
Thank you
Because localize depends on flutter_localizations any from sdk which depends on intl 0.16.0, intl 0.16.0 is required.
So, because localize depends on intl ^0.15.7, version solving failed.
pub get failed (1; So, because localize depends on intl ^0.15.7, version solving failed.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.