Last active
December 12, 2019 18:52
-
-
Save fabian71/b9ce6871dda2f1f45a5692d3d548c6d4 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
| 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