This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 他の関数など... | |
void _updateFormType(EmailPasswordSignInFormType formType) { | |
model.updateFormType(formType); | |
_emailController.clear(); | |
_passwordController.clear(); | |
} | |
Widget _buildContent() { | |
return FocusScope( | |
node: _node, | |
child: Form( | |
onChanged: () => model.updateWith( | |
email: _emailController.text, password: _passwordController.text), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.stretch, | |
children: <Widget>[ | |
const SizedBox(height: 8.0), | |
_buildEmailField(), | |
if (model.formType != EmailPasswordSignInFormType.forgotPassword) ...<Widget>[ | |
const SizedBox(height: 8.0), | |
_buildPasswordField(), | |
], | |
const SizedBox(height: 8.0), | |
FormSubmitButton( | |
key: const Key('primary-button'), | |
text: model.primaryButtonText, | |
initialLoading: model.isLoading, | |
onPressed: model.isLoading ? null : _submit, | |
), | |
const SizedBox(height: 8.0), | |
TextButton( | |
key: const Key('secondary-button'), | |
child: Text(model.secondaryButtonText), | |
onPressed: model.isLoading | |
? null | |
: () => _updateFormType(model.secondaryActionFormType), | |
), | |
if (model.formType == EmailPasswordSignInFormType.signIn) | |
TextButton( | |
key: const Key('tertiary-button'), | |
child: const Text( | |
EmailPasswordSignInStrings.forgotPasswordQuestion), | |
onPressed: model.isLoading | |
? null | |
: () => _updateFormType( | |
EmailPasswordSignInFormType.forgotPassword), | |
), | |
], | |
), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment