LCOV - code coverage report
Current view: top level - auth/extensions - auth_extensions.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 14 33 42.4 %
Date: 2022-03-03 12:16:56 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:fast_immutable_collections/fast_immutable_collections.dart';
       2             : import 'package:firebase_auth/firebase_auth.dart';
       3             : import 'package:google_sign_in/google_sign_in.dart';
       4             : import 'package:sign_in_with_apple/sign_in_with_apple.dart';
       5             : 
       6             : import '../models/apple_id_credential.dart';
       7             : import '../models/auth_provider_data.dart';
       8             : import '../models/auth_user_data.dart';
       9             : import '../models/google_sign_in_credential.dart';
      10             : 
      11             : extension FirebaseUserExtension on User {
      12           2 :   AuthUserData toModel() => AuthUserData(
      13           1 :       uid: uid,
      14           1 :       tenantId: tenantId,
      15           1 :       displayName: displayName,
      16           1 :       photoURL: photoURL,
      17           1 :       email: email,
      18           1 :       phoneNumber: phoneNumber,
      19           3 :       createdOn: metadata.creationTime?.toUtc(),
      20           3 :       lastSignedInOn: metadata.lastSignInTime?.toUtc(),
      21           1 :       isAnonymous: isAnonymous,
      22           1 :       emailVerified: emailVerified,
      23           1 :       providers: providerData
      24           1 :           .map<AuthProviderData>((userInfo) => userInfo.toModel())
      25           1 :           .toIList());
      26             : }
      27             : 
      28             : extension UserInfoExtension on UserInfo {
      29           0 :   AuthProviderData toModel() => AuthProviderData(
      30           0 :         providerId: providerId,
      31           0 :         uid: uid,
      32           0 :         displayName: displayName,
      33           0 :         photoURL: photoURL,
      34           0 :         email: email,
      35           0 :         phoneNumber: phoneNumber,
      36             :       );
      37             : }
      38             : 
      39             : extension AuthorizationCredentialAppleIDExt on AuthorizationCredentialAppleID {
      40           0 :   AppleIdCredential toModel() => AppleIdCredential(
      41           0 :       userIdentifier: userIdentifier,
      42           0 :       givenName: givenName,
      43           0 :       familyName: familyName,
      44           0 :       email: email,
      45           0 :       authorizationCode: authorizationCode,
      46           0 :       identityToken: identityToken,
      47           0 :       state: state);
      48             : }
      49             : 
      50             : extension GoogleSignInAuthenticationExtension on GoogleSignInAuthentication {
      51           0 :   GoogleSignInCredential toModel() => GoogleSignInCredential(
      52           0 :       idToken: idToken,
      53           0 :       accessToken: accessToken,
      54           0 :       serverAuthCode: serverAuthCode);
      55             : }

Generated by: LCOV version 1.13