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 'auth_manager.dart'; | |
| AuthManager getManager() => | |
| throw UnsupportedError('Cannot create an auth manager'); |
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 'package:flutter_auth0/flutter_auth0.dart'; | |
| //other imports | |
| class Auth0Manager extends AuthManager { | |
| @override | |
| Future<User> login([Map<String, String> authResponse]) async { | |
| //stuff that uses classic dart.io | |
| } | |
| @override | |
| Future<User> userFromTokens(String idToken, String accessToken) async { |
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 'auth_manager.dart'; | |
| import 'dart:js' as js; | |
| //other imports | |
| class Auth0ManagerForWeb extends AuthManager { | |
| @override | |
| Future<User> login([Map<String, String> authResponse]) async { | |
| //stuff that uses dart:js | |
| } |
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
| abstract class AuthManager { | |
| static AuthManager _instance; | |
| static AuthManager get instance { | |
| if (_instance == null) { | |
| if (kIsWeb) { | |
| _instance = Auth0ManagerForWeb(); | |
| } else { | |
| _instance = Auth0Manager(); | |
| } |
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 'dart:async'; | |
| import 'dart:convert'; | |
| import 'dart:js' as js; | |
| import 'package:my_app/providers/user_provider/model/user.dart'; | |
| import 'package:my_app/providers/user_provider/user_provider.dart'; | |
| import 'auth_manager.dart'; | |
| void _alert(dynamic param) { |
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
| function createAuth0Manager(clientParameters, onAuthenticated, onAuthError) { | |
| return new Auth0Manager(clientParameters, onAuthenticated, onAuthError); | |
| } | |
| class Auth0Manager { | |
| constructor(clientParameters, onAuthenticated, onAuthError) { | |
| this.clientParameters = clientParameters; | |
| this.onAuthenticated = onAuthenticated; | |
| this.onAuthError = onAuthError; | |
| this.auth0Client = new auth0.WebAuth({ |
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 'package:flutter/material.dart'; | |
| typedef SnapshotBuilder<T> = Widget Function(AsyncSnapshot<T>); | |
| class SnapshotHelper<T> { | |
| final AsyncSnapshot<T> snapshot; | |
| SnapshotHelper._(this.snapshot); | |
| factory SnapshotHelper.of(AsyncSnapshot snapshot) => |
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
| class Config { | |
| static const bool enable = false; | |
| } | |
| class Features { | |
| void runCheck() { | |
| List<String> features = [ | |
| "feature1", | |
| if (Config.enable) "feature2", | |
| ]; |
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
| class Config { | |
| static final bool enable = false; | |
| } | |
| class Features { | |
| void runCheck() { | |
| List<String> features = [ | |
| "feature1", | |
| if (Config.enable) "feature2", | |
| ]; |
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 'package:dio/dio.dart'; | |
| import 'package:dio/src/dio.dart'; | |
| import 'package:my_test_app/config/application_config.dart'; | |
| import 'package:my_test_app/dependency_injection/dependency_injector_base.dart'; | |
| import 'package:my_test_app/features/login/login_bloc.dart'; | |
| import 'package:my_test_app/features/login/login_service.dart'; | |
| import 'package:my_test_app/features/splash/splash_bloc.dart'; | |
| import 'package:my_test_app/features/splash/splash_service.dart'; | |
| class DependencyInjector extends DependencyInjectorBase { |