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

          Line data    Source code
       1             : class ActivityMarker {
       2             :   bool _allRead = false;
       3             :   bool _allSeen = false;
       4             : 
       5             :   Set<String> _readIds = {};
       6             :   Set<String> _seenIds = {};
       7             : 
       8           1 :   ActivityMarker allRead() {
       9           1 :     _allRead = true;
      10             :     return this;
      11             :   }
      12             : 
      13           3 :   ActivityMarker allSeen() {
      14           3 :     _allSeen = true;
      15             :     return this;
      16             :   }
      17             : 
      18           1 :   ActivityMarker read(Iterable<String> activityIds) {
      19           1 :     if (!_allRead) {
      20           3 :       _readIds = {..._readIds, ...activityIds};
      21             :     }
      22             :     return this;
      23             :   }
      24             : 
      25           1 :   ActivityMarker seen(Iterable<String> activityIds) {
      26           1 :     if (!_allSeen) {
      27           3 :       _seenIds = {..._seenIds, ...activityIds};
      28             :     }
      29             :     return this;
      30             :   }
      31             : 
      32           5 :   Map<String, Object> get params {
      33           5 :     final params = <String, Object>{};
      34           5 :     if (_allRead) {
      35           1 :       params['mark_read'] = 'true';
      36          10 :     } else if (_readIds.isNotEmpty) {
      37           3 :       params['mark_read'] = _readIds.join(',');
      38             :     }
      39             : 
      40           5 :     if (_allSeen) {
      41           3 :       params['mark_seen'] = 'true';
      42           6 :     } else if (_seenIds.isNotEmpty) {
      43           3 :       params['mark_seen'] = _seenIds.join(',');
      44             :     }
      45             :     return params;
      46             :   }
      47             : }

Generated by: LCOV version 1.15