Skip to content

Instantly share code, notes, and snippets.

@swat-cat
Created October 25, 2018 17:46
Show Gist options
  • Select an option

  • Save swat-cat/b73adf587a86d07f5ccf8600cab70a5e to your computer and use it in GitHub Desktop.

Select an option

Save swat-cat/b73adf587a86d07f5ccf8600cab70a5e to your computer and use it in GitHub Desktop.
Widget content(LoginViewModel viewModel, BoxConstraints constraints) =>
(viewModel.status != LoadingStatus.loading || viewModel?.type == ScreenState.WELCOME)? new Container(
child: new Stack(
fit: StackFit.expand,
alignment: Alignment.topCenter,
children: <Widget>[
new Align(
alignment: Alignment.topCenter,
child: new Transform(
transform: new Matrix4.translationValues(0.0, _animation.value, 0.0),
child: SingleChildScrollView(
child: new Column(
children: <Widget>[
...
viewModel.type == ScreenState.SINGIN?new Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
emailInput(viewModel),
(viewModel.status == LoadingStatus.error && viewModel.emailError.isNotEmpty)?emailError(viewModel):const SizedBox(),
...
Padding(
padding: const EdgeInsets.only(left: 65.0,right: 65.0,top: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
...
loginBtn((){
viewModel.login(viewModel.email,viewModel.password);
})
],
),
),
...
termsAndConditions(),
new Padding(padding: const EdgeInsets.all(16.0))
],
):Container()
],
),
),
),
),
],
),
):new Center(
child: new CircularProgressIndicator(),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment