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/27e60347058c504338c99ddf342c5322 to your computer and use it in GitHub Desktop.
Save Vanethos/27e60347058c504338c99ddf342c5322 to your computer and use it in GitHub Desktop.
dynamic requestInterceptor(RequestOptions options) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
var token = prefs.get("token");
options.headers.addAll({"Token": "$token${DateTime.now()}"});
return options;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment