Created
September 18, 2019 15:35
-
-
Save arifai/51158c5fa63682ce884cd7405a06613a to your computer and use it in GitHub Desktop.
This file contains 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
_EditAddressFormState(this.accountBloc) { | |
subs = accountBloc.state.listen((AccountState state) { | |
if (state is AddressUpdated) { | |
Navigator.pop(_context, true); | |
} else if (state is EditAddressFailure) { | |
Scaffold.of(_context).showSnackBar( | |
SnackBar( | |
content: Text(state.error), | |
backgroundColor: Colors.red, | |
), | |
); | |
} | |
}); | |
} | |
@override | |
void dispose() { | |
super.dispose(); | |
subs.cancel(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment