LCOV - code coverage report
Current view: top level - lib/data/models/authentication - app_user_model.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 11 11 100.0 %
Date: 2020-06-26 11:36:11 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:app_pym/domain/entities/authentication/app_user.dart';
       2             : import 'package:flutter/foundation.dart';
       3             : import 'package:freezed_annotation/freezed_annotation.dart';
       4             : import 'package:json_annotation/json_annotation.dart';
       5             : 
       6             : part 'app_user_model.g.dart';
       7             : part 'app_user_model.freezed.dart';
       8             : 
       9             : @freezed
      10             : abstract class AppUserModel with _$AppUserModel {
      11             :   const factory AppUserModel({
      12             :     @required int id,
      13             :     @nullable @required String email,
      14             :     @nullable @required String username,
      15             :     @nullable @required String password,
      16             :     @nullable @required String role,
      17             :     @nullable @required bool is_email_verified,
      18             :     @nullable @required String token,
      19             :   }) = _AppUserModel;
      20             : 
      21           3 :   factory AppUserModel.fromJson(Map<String, dynamic> json) =>
      22           3 :       _$AppUserModelFromJson(json);
      23             : }
      24             : 
      25             : extension AppUserModelX on AppUserModel {
      26           2 :   AppUser toEntity() {
      27           2 :     return AppUser(
      28           2 :       id: this.id,
      29           2 :       email: this.email,
      30           2 :       username: this.username,
      31           2 :       password: this.password,
      32           2 :       role: this.role,
      33           2 :       is_email_verified: this.is_email_verified,
      34           2 :       token: this.token,
      35             :     );
      36             :   }
      37             : }

Generated by: LCOV version 1.13