Created
July 15, 2020 10:40
-
-
Save magicleon94/a2bf9a4f60e1be50809a9050df52910d to your computer and use it in GitHub Desktop.
abstract auth manager with conditionall imports - for medium article
This file contains hidden or 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
import 'auth0_manager_stub.dart' | |
if (dart.library.io) 'auth0_manager.dart' | |
if (dart.library.js) 'auth0_manager_for_web.dart'; | |
abstract class AuthManager { | |
static AuthManager _instance; | |
static AuthManager get instance { | |
_instance ??= getManager(); | |
return _instance; | |
} | |
Future<User> login([Map<String, String> authResponse]); | |
Future<User> userFromTokens(String idToken, String accessToken); | |
Future<void> logout(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment