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

          Line data    Source code
       1             : import 'package:app_pym/domain/entities/map_pym/batiment.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 'batiment_model.g.dart';
       8             : part 'batiment_model.freezed.dart';
       9             : 
      10             : @freezed
      11             : abstract class BatimentModel with _$BatimentModel {
      12             :   @HiveType(typeId: 1)
      13             :   @JsonSerializable(explicitToJson: true)
      14             :   const factory BatimentModel({
      15             :     @required @HiveField(0) int id,
      16             :     @nullable @required @HiveField(1) String nom,
      17             :     @nullable @required @HiveField(2) int nbEtage,
      18             :     @nullable @required @HiveField(3) String description,
      19             :     @nullable @required @HiveField(4) bool accesHandicape,
      20             :     @nullable @required @HiveField(5) String url,
      21             :     @nullable @required @HiveField(6) String adresse,
      22             :     @nullable @required @HiveField(7) double latitude,
      23             :     @nullable @required @HiveField(8) double longitude,
      24             :     @nullable @required @HiveField(9) bool isVisibleAR,
      25             :     @nullable @required @HiveField(10) String img_url,
      26             :   }) = _BatimentModel;
      27             : 
      28           3 :   factory BatimentModel.fromJson(Map<String, dynamic> json) =>
      29           3 :       _$BatimentModelFromJson(json);
      30             : }
      31             : 
      32           0 : TypeAdapter<BatimentModel> BatimentModelAdapter() => _$_BatimentModelAdapter();
      33             : 
      34             : extension BatimentModelX on BatimentModel {
      35           2 :   Batiment toEntity() {
      36           2 :     return Batiment(
      37           2 :       accesHandicape: this.accesHandicape,
      38           2 :       adresse: this.adresse,
      39           2 :       description: this.description,
      40           2 :       nbEtage: this.nbEtage,
      41           2 :       nom: this.nom,
      42           2 :       url: this.url,
      43           2 :       id: this.id,
      44           2 :       latitude: this.latitude,
      45           2 :       longitude: this.longitude,
      46           2 :       isVisibleAR: this.isVisibleAR,
      47           2 :       img_url: this.img_url,
      48             :     );
      49             :   }
      50             : }

Generated by: LCOV version 1.13