pin_code_fields
pin_code_fields copied to clipboard
How can I delete after completion?
When we complete all the character fields, it becomes unfocused and we cannot delete it, can you help with this?
Package; always last version
Flutter doctor:
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.5 21G72 darwin-arm, locale
tr-TR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.70.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
My Code;
PinCodeTextField(
length: 6,
obscureText: false,
animationType: AnimationType.fade,
focusNode: controller.myFocusNode,
autoDisposeControllers: false,
autoFocus: true,
autoUnfocus: false,
pinTheme: PinTheme(
inactiveColor: Colors.grey.shade300, //inactive border side
inactiveFillColor: AppColors.WHITE_OPACITY,
///inactive background
activeColor: Colors.white,
activeFillColor: AppColors.ORANGE,
selectedColor: AppColors.ORANGE,
selectedFillColor: AppColors.ORANGE,
shape: PinCodeFieldShape.box,
borderRadius: BorderRadius.circular(5),
fieldHeight: 50,
fieldWidth: 40,
fieldOuterPadding: EdgeInsets.all(3)),
animationDuration: Duration(milliseconds: 300),
enableActiveFill: true,
errorAnimationController: controller.errorController,
controller: controller.textEditingController,
validator: (value) {
if (value == null || value.length < 6) {
print(value);
controller.hasError.value = true;
return "";
} else {
return null;
}
},
onCompleted: (v) {
print("Completed");
controller.myFocusNode;
},
onChanged: (value) {
print(value);
controller.currentText.value = value;
},
beforeTextPaste: (text) {
print("Allowing to paste $text");
//if you return true then it will show the paste confirmation dialog. Otherwise if false, then nothing will happen.
//but you can show anything you want here, like your pop up saying wrong paste format or etc
return true;
},
appContext: Get.context!),