Skip to content

Instantly share code, notes, and snippets.

@fabian71
Last active December 12, 2019 18:52
Show Gist options
  • Select an option

  • Save fabian71/b9ce6871dda2f1f45a5692d3d548c6d4 to your computer and use it in GitHub Desktop.

Select an option

Save fabian71/b9ce6871dda2f1f45a5692d3d548c6d4 to your computer and use it in GitHub Desktop.
Stepper(
type: stepperType,
... "continue" ...
onStepContinue: ()async {
var data = await onClickSave();
pet = data;
print(pet);
setState(() {
print('entrouuuuuuuu');
});
},
onStepCancel: () {},
onStepTapped: (step) {
setState(() {
this._currentStep = step;
});
},
);
Future<User> onClickSave() async {
Future<User> user = User.get();
user.then((user) async {
// Save User
setState(() {
_showProgress = true;
});
await Future.delayed(Duration(seconds: 3));
ApiResponse<User> response = await UserApi.save(c);
setState(() {
_showProgress = false;
});
if (response != null) {
//Usuario salvo retornado
print('retornou o usuário');
return response;
} else {
return null;
}
}, onError: (error){
print(error);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment