Skip to content

Instantly share code, notes, and snippets.

@Vanethos
Created September 5, 2019 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vanethos/0ef0ec70cb774c070f0b828f25a86dec to your computer and use it in GitHub Desktop.
Save Vanethos/0ef0ec70cb774c070f0b828f25a86dec to your computer and use it in GitHub Desktop.
dynamic errorInterceptor(DioError dioError) {
if (dioError.message.contains("ERROR_001")) {
// this will push a new route and remove all the routes that were present
navigatorKey.currentState.pushNamedAndRemoveUntil(
"/login", (Route<dynamic> route) => false);
}
return dioError;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment