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

          Line data    Source code
       1             : import 'package:app_pym/domain/entities/map_pym/entreprise.dart';
       2             : import 'package:flutter/foundation.dart';
       3             : import 'package:freezed_annotation/freezed_annotation.dart';
       4             : import 'package:hive/hive.dart';
       5             : import 'package:json_annotation/json_annotation.dart';
       6             : 
       7             : part 'entreprise_model.g.dart';
       8             : part 'entreprise_model.freezed.dart';
       9             : 
      10             : @freezed
      11             : abstract class EntrepriseModel with _$EntrepriseModel {
      12             :   @HiveType(typeId: 2)
      13             :   @JsonSerializable(explicitToJson: true)
      14             :   const factory EntrepriseModel({
      15             :     @required @HiveField(0) int id,
      16             :     @nullable @required @HiveField(1) String nom,
      17             :     @nullable @required @HiveField(2) String site_internet,
      18             :     @nullable @required @HiveField(3) int nb_salaries,
      19             :     @nullable @required @HiveField(4) String telephone,
      20             :     @nullable @required @HiveField(5) String mail,
      21             :     @nullable @required @HiveField(6) String logo,
      22             :     @nullable @required @HiveField(7) int idBatiment,
      23             :   }) = _EntrepriseModel;
      24             : 
      25           3 :   factory EntrepriseModel.fromJson(Map<String, dynamic> json) =>
      26           3 :       _$EntrepriseModelFromJson(json);
      27             : }
      28             : 
      29           0 : TypeAdapter<EntrepriseModel> EntrepriseModelAdapter() =>
      30           0 :     _$_EntrepriseModelAdapter();
      31             : 
      32             : extension EntrepriseModelX on EntrepriseModel {
      33           2 :   Entreprise toEntity() {
      34           2 :     return Entreprise(
      35           2 :       id: this.id,
      36           2 :       logo: this.logo,
      37           2 :       mail: this.mail,
      38           2 :       nb_salaries: this.nb_salaries,
      39           2 :       nom: this.nom,
      40           2 :       site_internet: this.site_internet,
      41           2 :       telephone: this.telephone,
      42           2 :       idBatiment: this.idBatiment,
      43             :     );
      44             :   }
      45             : }

Generated by: LCOV version 1.13