Skip to content

Instantly share code, notes, and snippets.

@ptruiz
Created October 12, 2020 22:30
Show Gist options
  • Save ptruiz/92ef9b97087eab8510e2f8297350f252 to your computer and use it in GitHub Desktop.
Save ptruiz/92ef9b97087eab8510e2f8297350f252 to your computer and use it in GitHub Desktop.
StreamSubscription deepLinkSubscription;
@override
void initState() {
deepLinkSubscription = getLinksStream().listen((String link) {
String code = getCodeFromGitHubLink(link);
}, cancelOnError: true);
super.initState();
}
String getCodeFromGitHubLink(String link) {
if(link != null) {
return link.substring(link.indexOf(RegExp('code=')) + 5);
} else {
return "";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment