Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

onDone is called always, even if it's not required #57

Open
talamaska opened this issue Apr 28, 2021 · 1 comment
Open

onDone is called always, even if it's not required #57

talamaska opened this issue Apr 28, 2021 · 1 comment

Comments

@talamaska
Copy link

Describe the bug
I upgraded to flutter 2, I'm not using the latest version I'm on 1.7.1. Despite pub.dev displaying some 1.8.0 which I don't see here in master.
I haven't set onDone callback,
When I filled the fields I go an error in the console

The method 'call' was called on null.
Receiver: null
Tried calling: call("0000")

When the exception was thrown, this was the stack
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1      PinCodeTextFieldState._onTextChanged
package:pin_code_text_field/pin_code_text_field.dart:453
#2      EditableTextState._formatAndSetValue
package:flutter/…/widgets/editable_text.dart:2276
#3      EditableTextState.updateEditingValue
package:flutter/…/widgets/editable_text.dart:1731
#4      TextInput._handleTextInputInvocation

Expected behavior
Either make onDone required or make the onDone call conditional

Smartphone Emulator:

  • OS: Android
  • Version 29

Additional context
I see widget.onCHnaged is called with ?.call maybe onDone should also be called with this.

** flutter doctor **
[√] Flutter (Channel stable, 2.0.4, on Microsoft Windows [Version 10.0.19042.928], locale bg-BG)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] VS Code, 64-bit edition (version 1.55.2)
[√] Connected device (3 available)

@talamaska
Copy link
Author

@LiewJunTung any plans to fix the callback requirement?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant