-
-
Save Vanethos/0ef0ec70cb774c070f0b828f25a86dec 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
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