LCOV - code coverage report
Current view: | top level - src/models/organizers - expandable_organizer.dart (source / functions) |  |  | Hit | Total | Coverage
Test: | lcov.info |  | Lines: | 10 | 12 | 83.3 %
Date: | 2021-10-11 06:57:03 |  | Functions: | 0 | 0 | -

              Line data    Source code
           1             : import 'package:collection/collection.dart';
           2             :
           3             : import 'package:widgetbook/src/models/organizers/organizer.dart';
           4             : import 'package:widgetbook/src/models/organizers/organizers.dart';
           5             :
           6             : /// ExpandableOrganizer is an abstract model which can host
           7             : /// WidgetElements and/or Folders
           8             : abstract class ExpandableOrganizer extends Organizer {
           9           2 :   ExpandableOrganizer({
          10             :     required String name,
          11             :     required this.isExpanded,
          12             :     List<Folder>? folders,
          13             :     List<WidgetElement>? widgets,
          14           2 :   })  : folders = folders ?? List<Folder>.empty(),
          15           2 :         widgets = widgets ?? List<WidgetElement>.empty(),
          16           2 :         super(
          17             :           name,
          18             :         );
          19             :
          20             :   /// Used to implement collapsing and expanding of the folder tree.
          21             :   bool isExpanded;
          22             :
          23             :   /// The folders of one level in the folder tree.
          24             :   /// Folders will be shown above widgets.
          25             :   final List<Folder> folders;
          26             :
          27             :   /// The widgets of one level in the folder tree.
          28             :   /// Widgets will be shown below folders;
          29             :   final List<WidgetElement> widgets;
          30             :
          31             :   /// Abstract class for organizer panel in the left.
          32             :
          33           2 :   @override
          34             :   bool operator ==(Object other) {
          35             :     if (identical(this, other)) return true;
          36           2 :     final listEquals = const DeepCollectionEquality().equals;
          37             :
          38           2 :     return other is ExpandableOrganizer &&
          39           6 :         other.isExpanded == isExpanded &&
          40           4 :         listEquals(other.folders, folders) &&
          41           4 :         listEquals(other.widgets, widgets);
          42             :   }
          43             :
          44           0 :   @override
          45           0 :   int get hashCode => isExpanded.hashCode ^ folders.hashCode ^ widgets.hashCode;
          46             : }

Generated by: LCOV version 1.15