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

              Line data    Source code
           1             : import 'package:flutter/material.dart';
           2             :
           3             : import 'package:widgetbook/src/models/model.dart';
           4             : import 'package:widgetbook/src/models/organizers/organizer.dart';
           5             :
           6             : /// Stories represent a specific configuration of a widget.
           7             : class Story extends Organizer implements Model {
           8           8 :   Story({required String name, required this.builder}) : super(name);
           9             :
          10           0 :   factory Story.center({
          11             :     required String name,
          12             :     required Widget child,
          13             :   }) {
          14           0 :     return Story(
          15             :       name: name,
          16           0 :       builder: (_) => Center(child: child),
          17             :     );
          18             :   }
          19             :
          20           1 :   factory Story.child({
          21             :     required String name,
          22             :     required Widget child,
          23             :   }) {
          24           1 :     return Story(
          25             :       name: name,
          26           0 :       builder: (_) => child,
          27             :     );
          28             :   }
          29             :
          30             :   final Widget Function(BuildContext) builder;
          31             :
          32           2 :   @override
          33           2 :   String get id => path;
          34             :
          35           2 :   @override
          36             :   bool operator ==(Object other) {
          37             :     if (identical(this, other)) return true;
          38             :
          39           4 :     return other is Story && other.builder == builder;
          40             :   }
          41             :
          42           1 :   @override
          43           2 :   int get hashCode => builder.hashCode;
          44             : }

Generated by: LCOV version 1.15