loginWithFirebase method

Future<QBLoginResult> loginWithFirebase(
  1. String projectId,
  2. String token
)

Implementation

Future<QBLoginResult> loginWithFirebase(String projectId, String token) async {
  Map<Object?, Object?> map = await _authModule.invokeMethod(LOGIN_WITH_FIREBASE_METHOD, [projectId, token]);

  Map<Object?, Object?> userMap = Map.from(map["user"] as Map<Object?, Object?>);
  Map<Object?, Object?> sessionMap = Map.from(map["session"] as Map<Object?, Object?>);

  QBUser? qbUser = QBUserMapper.mapToQBUser(userMap);
  QBSession? qbSession = QBSessionMapper.mapToQBSession(sessionMap);

  QBLoginResult result = QBLoginResult(qbUser, qbSession);

  return result;
}