Created
October 12, 2020 22:30
-
-
Save ptruiz/92ef9b97087eab8510e2f8297350f252 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
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