Skip to content

Null check operator used on a null value exception from date_formatter #23

@claptv

Description

@claptv

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions