File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ import 'package:ensemble/framework/action.dart' ;
2
+ import 'package:ensemble/framework/event.dart' ;
3
+ import 'package:ensemble/framework/stub/auth_context_manager.dart' ;
4
+ import 'package:ensemble/screen_controller.dart' ;
5
+ import 'package:ensemble/widget/stub_widgets.dart' ;
6
+ import 'package:ensemble_auth/signin/auth_manager.dart' ;
7
+ import 'package:flutter/material.dart' ;
8
+
9
+ class SignInWithCustomAuthImpl implements SignInWithCustomAuth {
10
+ @override
11
+ Future <void > signInWithCustomAuth (BuildContext context,
12
+ {required SignInWithCustomAuthAction action}) async {
13
+ final isAuthenticated = await AuthManager ().signInWithCustomAuth (context,idToken: action.idToken! );
14
+ if (isAuthenticated != null ) {
15
+ if (action.onAuthenticated != null ) {
16
+ AuthenticatedUser ? currentUser = AuthManager ().getCurrentUser ();
17
+ ScreenController ().executeAction (context, action.onAuthenticated! ,
18
+ event: EnsembleEvent (null , data: {'user' : currentUser}));
19
+ }
20
+ } else {
21
+ if (action.onError != null ) {
22
+ ScreenController ().executeAction (context, action.onError! );
23
+ }
24
+ }
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments