LCOV - code coverage report
Current view: top level - core/models - follow.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 15 15 100.0 %
Date: 2021-04-14 08:03:52 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:equatable/equatable.dart';
       2             : import 'package:json_annotation/json_annotation.dart';
       3             : 
       4             : part 'follow.g.dart';
       5             : 
       6             : ///
       7             : @JsonSerializable()
       8             : class Follow extends Equatable {
       9             :   ///
      10           4 :   const Follow(this.feedId, this.targetId);
      11             : 
      12             :   /// Create a new instance from a json
      13           4 :   factory Follow.fromJson(Map<String, dynamic> json) => _$FollowFromJson(json);
      14             : 
      15             :   ///
      16             :   final String? feedId;
      17             : 
      18             :   ///
      19             :   final String? targetId;
      20             : 
      21           1 :   @override
      22           3 :   List<Object?> get props => [feedId, targetId];
      23             : 
      24             :   /// Serialize to json
      25           2 :   Map<String, dynamic> toJson() => _$FollowToJson(this);
      26             : }
      27             : 
      28             : ///
      29             : @JsonSerializable()
      30             : class UnFollow extends Follow {
      31             :   ///
      32           2 :   const UnFollow(String? feedId, String? targetId, this.keepHistory)
      33           1 :       : super(feedId, targetId);
      34             : 
      35             :   /// Create a new instance from a json
      36           1 :   factory UnFollow.fromJson(Map<String, dynamic> json) =>
      37           1 :       _$UnFollowFromJson(json);
      38             : 
      39             :   ///
      40           1 :   factory UnFollow.fromFollow(Follow follow, bool? keepHistory) =>
      41           3 :       UnFollow(follow.feedId, follow.targetId, keepHistory);
      42             : 
      43             :   ///
      44             :   final bool? keepHistory;
      45             : 
      46           1 :   @override
      47           3 :   List<Object?> get props => [...super.props, keepHistory];
      48             : 
      49             :   /// Serialize to json
      50           1 :   @override
      51           1 :   Map<String, dynamic> toJson() => _$UnFollowToJson(this);
      52             : }

Generated by: LCOV version 1.15