Skip to content

Instantly share code, notes, and snippets.

@WillyShakes
Last active February 21, 2018 06:12
Show Gist options
  • Save WillyShakes/07843c9e81d9ff1819c9db96292d6a0d to your computer and use it in GitHub Desktop.
Save WillyShakes/07843c9e81d9ff1819c9db96292d6a0d to your computer and use it in GitHub Desktop.
flutter auth login presenter
class LoginPresenter {
LoginViewContract _view;
LoginPresenter(this._view);
void perform_login() {
assert(_view != null);
insta.getToken(<APP_ID>,
<APP_SECRET>).then((token)
{
if (token != null) {
_view.onLoginScuccess(token.access);
}
else {
_view.onLoginError('Error');
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment