LCOV - code coverage report
Current view: top level - src/providers - organizer_state.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 9 13 69.2 %
Date: 2021-10-03 15:54:23 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:collection/collection.dart';
       2             : 
       3             : import 'package:widgetbook/src/models/models.dart';
       4             : 
       5             : class OrganizerState {
       6             :   final List<Category> allCategories;
       7             :   final List<Category> filteredCategories;
       8             :   final String searchTerm;
       9             : 
      10           1 :   factory OrganizerState.unfiltered({
      11             :     required List<Category> categories,
      12             :   }) {
      13           1 :     return OrganizerState(
      14             :       allCategories: categories,
      15             :       filteredCategories: categories,
      16             :       searchTerm: '',
      17             :     );
      18             :   }
      19             : 
      20           1 :   OrganizerState({
      21             :     required this.allCategories,
      22             :     required this.filteredCategories,
      23             :     required this.searchTerm,
      24             :   });
      25             : 
      26           1 :   @override
      27             :   bool operator ==(Object other) {
      28             :     if (identical(this, other)) return true;
      29           1 :     final listEquals = const DeepCollectionEquality().equals;
      30             : 
      31           1 :     return other is OrganizerState &&
      32           2 :         listEquals(other.allCategories, allCategories) &&
      33           2 :         listEquals(other.filteredCategories, filteredCategories) &&
      34           3 :         other.searchTerm == searchTerm;
      35             :   }
      36             : 
      37           0 :   @override
      38             :   int get hashCode =>
      39           0 :       allCategories.hashCode ^
      40           0 :       filteredCategories.hashCode ^
      41           0 :       searchTerm.hashCode;
      42             : }

Generated by: LCOV version 1.15