handleMethodCall method

Future handleMethodCall(
  1. MethodCall methodCall
)

Handles method calls that would normally be sent to the native backend. Returns with the expected values based on the current user.

Implementation

Future<dynamic> handleMethodCall(MethodCall methodCall) async {
  switch (methodCall.method) {
    case 'init':
      // do nothing
      return null;
    case 'getTokens':
      return <String, String?>{
        'idToken': user.idToken,
        'accessToken': user.accessToken,
      };
    case 'signIn':
      return user._asMap;
    case 'signInSilently':
      return user._asMap;
    case 'signOut':
      return <String, String>{};
    case 'disconnect':
      return <String, String>{};
  }
}