Closed JEuler closed 4 years ago
You could just set a key
for the FlutterMention
widget & then just use these two ways to clear the field.
Using the controller's clear method:
key.currentState.controller.clear();
Using the controller's text property:
key.currentState.controller.text = '';
Thank you very much!
@fayeed
Bringing the key in the parent widget creates me this error:
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
Multiple widgets used the same GlobalKey.
How can we please access the key
from a different widget ?
@fayeed
Bringing the key in the parent widget creates me this error:
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
Multiple widgets used the same GlobalKey.
How can we please access the key
from a different widget ?
How I can clear text field after onEditingComplete callback? Setting
defaultText
not working