Created
June 15, 2020 19:12
-
-
Save ookami-kb/b06c9c1c7796a1d6f6f4a65ffff16d93 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@override | |
Widget build(BuildContext context) => Scaffold( | |
body: SingleChildScrollView( | |
child: Padding( | |
padding: const EdgeInsets.symmetric(horizontal: 16), | |
child: Column( | |
children: <Widget>[ | |
Padding( | |
padding: const EdgeInsets.only(top: 145, bottom: 102), | |
child: SvgPicture.asset( | |
'assets/mews_logo.svg', | |
height: 28, | |
width: 136, | |
), | |
), | |
StreamBuilder<String>( | |
stream: bloc.email, | |
builder: (context, snapshot) => MewsInputField( | |
textInputAction: TextInputAction.next, | |
onSubmitted: (_) { | |
FocusScope.of(context).requestFocus(_passwordFocus); | |
}, | |
label: _translate(TranslationKey.UserNameOrEmail), | |
placeholder: _translate(TranslationKey.UserNameOrEmail), | |
onChanged: bloc.onEmailChanged, | |
keyboardType: TextInputType.emailAddress, | |
error: (snapshot.error as ValidationError)?.message, | |
isRequired: true, | |
), | |
), | |
Padding( | |
padding: const EdgeInsets.only(top: 24), | |
child: StreamBuilder<String>( | |
stream: bloc.password, | |
builder: (context, snapshot) => MewsInputField( | |
enableInteractiveSelection: true, | |
textInputAction: TextInputAction.go, | |
onSubmitted: (_) => _logIn(), | |
focusNode: _passwordFocus, | |
isPasswordField: true, | |
label: _translate(TranslationKey.Password), | |
placeholder: _translate(TranslationKey.Password), | |
onChanged: bloc.onPasswordChanged, | |
error: (snapshot.error as ValidationError)?.message, | |
isRequired: true, | |
), | |
), | |
), | |
Padding( | |
padding: const EdgeInsets.only(top: 40), | |
child: MewsFillButton( | |
minWidth: double.infinity, | |
onPressed: _logIn, | |
text: _translate(TranslationKey.SignIn), | |
), | |
), | |
Padding( | |
padding: const EdgeInsets.only(top: 16), | |
child: StreamBuilder<Environment>( | |
stream: _environmentBloc.environment, | |
initialData: Environment.production, | |
builder: (context, snapshot) => MewsGhostButton( | |
minWidth: double.infinity, | |
text: 'Environment: ${snapshot.data.name}', | |
onPressed: _displayChangeEnvironmentDialog, | |
), | |
), | |
) | |
], | |
), | |
), | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment