adar2378 / pin_code_fields

A flutter package which will help you to generate pin code fields with beautiful design and animations. Can be useful for OTP or pin code inputs 🤓🤓
https://pub.dev/packages/pin_code_fields
MIT License
690 stars 336 forks source link

Don't enter anything on web #284

Closed AndreyMolochko closed 1 year ago

AndreyMolochko commented 2 years ago

I try to enter something on web, but I can't. Initialized values from controller are shown, but entered no. OnChanged, Validators methods don't call. Flutter (Channel stable, 2.10.4)

Widget _testPin(BuildContext context) {
    return Container(
      height: 48,
      width: 400,
      child: PinCodeTextField(
        length: 6,
        controller: textEditingController,
        onChanged: (String value) {
          print("on changed!");
          print("value = $value");
        },
        appContext: context,
        keyboardType: TextInputType.number,
        pinTheme: PinTheme(
          fieldHeight: 48,
          fieldWidth: 60,
          borderRadius: BorderRadius.circular(8),
          inactiveColor: Colors.grey,
          activeColor: Colors.grey,
          selectedColor: Colors.grey,
          shape: PinCodeFieldShape.box,
          borderWidth: 1,
        ),
        validator: (v) {
          print("validator");
          if (v!.length < 5) {
            return "I'm from validator";
          } else {
            return null;
          }
        },
        onCompleted: (v) {
          debugPrint("Completed");
        },
      ),
    );
  }
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.