I used patrol package here is my test cases for Pinput widget.

 final TextEditingController controller = TextEditingController();
      const length = 4;
      final focusNode = FocusNode();
      final ref = ProviderContainer();
    
      await $.pumpWidget(
        UncontrolledProviderScope(
          container: ref,
          child: MaterialApp(
            home: Scaffold(
              body: Pinput(
                autofocus: true,
                controller: controller,
                focusNode: focusNode,
              ),
            ),
          ),
        ),
      );
      focusNode.requestFocus();
      await $.pump();
      const pinValue = '1234';
      await $.tester.enterText(find.byType(Pinput), pinValue);
      await $.tester.testTextInput.receiveAction(TextInputAction.done);
      await $.tester.pumpAndSettle();

here is the output [1]: https://i.stack.imgur.com/DPtFS.png

I added the issue here . you can check the more info here. https://github.com/Tkko/Flutter_Pinput/issues/140

0

There are 0 best solutions below