Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix obscure text #54

Closed
julek-kal opened this issue Apr 1, 2020 · 1 comment
Closed

Fix obscure text #54

julek-kal opened this issue Apr 1, 2020 · 1 comment

Comments

@julek-kal
Copy link

julek-kal commented Apr 1, 2020

Hi, when i try to use SuffixButton.obscureText in second step of stepper/wizard form, initial state is obscureText false, I must click on suffixButton, then obscureText is true. If i put this password field in first step, everything is ok.

class LoginFormBloc extends FormBloc<String, String> {
  final TextFieldBloc email = TextFieldBloc(
      validators: [FieldBlocValidators.required, FieldBlocValidators.email]);
  final TextFieldBloc password =
      TextFieldBloc(validators: [FieldBlocValidators.required]);
  LoginFormBloc() {
    addFieldBlocs(step: 0, fieldBlocs: [email]);
    addFieldBlocs(step: 1, fieldBlocs: [password]);
  }

StepperFormBlocBuilder<LoginFormBloc>(
                stepsBuilder: (formBloc) {
                  return [_emailStep(formBloc), _passwordStep(formBloc)];
                },
                physics: ClampingScrollPhysics(),
                type: StepperType.horizontal,
                formBloc: loginFormBloc,
              ));
FormBlocStep _passwordStep(LoginFormBloc loginFormBloc) {
  return FormBlocStep(
      title: Text('Password'),
      content: Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          Text('Enter password to sign in with your email'),
          TextFieldBlocBuilder(
            suffixButton: SuffixButton.obscureText,
            decoration: InputDecoration(
                prefixIcon: Icon(Icons.lock),
                hintText: 'Password',
                border: OutlineInputBorder()),
            textFieldBloc: loginFormBloc.password,
          ),
        ],
      ));
}
@GiancarloCode
Copy link
Owner

Thanks for reporting this.
Fixed in flutter_form_bloc: ^0.12.1

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

No branches or pull requests

2 participants