flutter_pattern_formatter icon indicating copy to clipboard operation
flutter_pattern_formatter copied to clipboard

Null check operator used on a null value exception from date_formatter

Open claptv opened this issue 3 years ago • 0 comments

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

claptv avatar Aug 03 '22 03:08 claptv