Giter Club home page Giter Club logo

flutter_pattern_formatter's Introduction

flutter_pattern_formatter's People

Contributors

eduardotq avatar hnvn avatar minhdanh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_pattern_formatter's Issues

Users lose their input if they try to type a second decimal separator

Not sure if relevant but I'm using a Locale where decimal separators are , eg: 12.345,67

Steps to reproduce:

  1. Simple Text field with a ThousandsFormatter(allowFraction: true) input formatter.
  2. Type 12345,67 which renders as 12.345,67
  3. Continue by typing ,

Expected:

  1. You see 12345,67

Actual:

  1. You see 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.

incompatible

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.)

Infinite input year

Maybe this is normal, I don’t know, but if you enter the year, and then click on the first digit and start entering numbers again, you can add them endlessly, but it’s impossible to delete them

image

Cannot upgrade to Flutter 2

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.

Feature: Support international number separators

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,
      ],
  }
}

Null check operator used on a null value exception from date_formatter

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'[^/]'), '');

Invalid radix-10 number (at character 1) when validating input with this formatter

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;
                                },

This package stills manteined?

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.

Does not allow entering 0 in the decimal section

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

Incompatibility flutter 1.12.13-hotfixes

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.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.