[Feature request] Enhancing Controller Support for Form Fields in Amplify Authenticator UI
On which framework/platform would you like to see this feature implemented?
Flutter
Which UI component is this feature-request for?
Authenticator
Please describe your feature-request in detail.
Currently, the Amplify Authenticator UI for Flutter does not allow programmatic modification of form field values through a controller—unlike other conventional form fields. This limitation restricts use cases such as pre-populating a field with data retrieved from an API (for example, automatically setting a user’s address based on GPS coordinates) or auto-filling an SMS verification code.
To improve functionality and flexibility, it is recommended that the Authenticator UI Library, particularly the SignUpFormField, be extended to include controller support. This enhancement would enable developers to seamlessly manage form values, thereby expanding the component’s utility and improving overall user experience.
Please describe a solution you'd like.
Create a new controller class for the fields used in the Auth lib, and expose it on the form field.
i have tried to manually change the widget.state.field but it's not reactive, when i change it the forms do not update even on setState.
Hello @angelorodem, thanks for taking the time to open this feature request. I think this is a good suggestion that would enable quality of life features for customers. While we would need to review what fields would support this, I believe we could support something like this:
final _usernameController = TextEditingController(text: 'MY_USERNAME');
final _emailController = TextEditingController(text: 'MY_EMAIL');
final _addressController = TextEditingController(text: 'MY_ADDRESS');
...
Authenticator(
signUpForm: SignUpForm.custom(
fields: [
SignUpFormField.username(controller: _usernameController, validator: _validateUsername),
SignUpFormField.email(controller: _emailController, required: true),
SignUpFormField.password(),
SignUpFormField.passwordConfirmation(),
SignUpFormField.address(controller: _addressController),
],
),
...
_addressController.text = 'MY_OTHER_ADDRESS';
I'll mark this as a feature request and we will provide any updates here!
Ok, thanks @tyllark ! for my knowledge, do you have an ETA on mind?
Thank you.
Hello @angelorodem, unfortunately we do not have an ETA at this time. When we do have an update we will post here.
@tyllark can you review the open PR?
Hello @angelorodem, thank you for the PR with a detailed explanation! I will review with the team and get back to you!
Thanks @tyllark , can you review when time permits? or someone else from the team, please?
Hello @angelorodem, sorry for the delay. I scheduled a meeting with the team to review the public API changes. I will post any feedback on the PR afterwards.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Hello @angelorodem Amplify Authenticator 2.4.0 was just launched with this feature. We appreciate all the hard work you put into the PR and I think it is a great addition to Authenticator!
Please let me know if you run into any issues with the new release, otherwise we will close out this issue!
Thanks for the help @tyllark !
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.