Very new to Flutter. How would I push a new route predicated on a condition invoked by a button press? (asynchronous sign in call).
This sort of thing: if signIn (async) = success -> Navigator.push
Cheers
Widget buildButtons() {
return new Container(
child: new Column(
children: <Widget>[
new MaterialButton(
minWidth: MediaQuery.of(context).size.width - 30, //FULL WIDTH - 30
color: Style.palette3,
padding: EdgeInsets.all(Style.padding1),
child: new Text('Sign in',
style: Style.signInBtn
),
onPressed: () {
if (LoginControl.signIn()) Navigator.push(context, MaterialPageRoute(builder: (context) => ArmDisarm()));
},
),
new FlatButton(
child: Padding(
padding: Style.paddingCreateAcc,
child: new Text(
'Create an account',
style: Style.fontSize1
),
),
),
],
),
);
}