LCOV - code coverage report
Current view: | top level - src/widgets/tiles - widget_tile.dart (source / functions) |  |  | Hit | Total | Coverage
Test: | lcov.info |  | Lines: | 0 | 19 | 0.0 %
Date: | 2021-10-11 06:57:03 |  | Functions: | 0 | 0 | -

              Line data    Source code
           1             : import 'package:flutter/material.dart';
           2             : import 'package:widgetbook/src/models/organizers/organizers.dart';
           3             : import 'package:widgetbook/src/providers/organizer_provider.dart';
           4             : import 'package:widgetbook/src/utils/utils.dart';
           5             : import 'package:widgetbook/src/widgets/tiles/spaced_tile.dart';
           6             : import 'package:widgetbook/src/widgets/tiles/story_tile.dart';
           7             :
           8             : class WidgetTile extends StatefulWidget {
           9           0 :   const WidgetTile({
          10             :     Key? key,
          11             :     required this.widgetElement,
          12             :     required this.level,
          13           0 :   }) : super(key: key);
          14             :
          15             :   final WidgetElement widgetElement;
          16             :   final int level;
          17             :
          18           0 :   @override
          19           0 :   _WidgetTileState createState() => _WidgetTileState();
          20             : }
          21             :
          22             : class _WidgetTileState extends State<WidgetTile> {
          23             :   bool expanded = false;
          24             :   bool hover = false;
          25             :
          26           0 :   List<Widget> _buildStories(int level) {
          27           0 :     final stories = widget.widgetElement.stories;
          28             :
          29             :     return stories
          30           0 :         .map(
          31           0 :           (Story story) => StoryTile(
          32             :             story: story,
          33             :             level: level,
          34             :           ),
          35             :         )
          36           0 :         .toList();
          37             :   }
          38             :
          39           0 :   @override
          40             :   Widget build(BuildContext context) {
          41           0 :     return Column(
          42             :       crossAxisAlignment: CrossAxisAlignment.start,
          43           0 :       children: [
          44           0 :         SpacedTile(
          45           0 :           level: widget.level,
          46           0 :           organizer: widget.widgetElement,
          47             :           iconData: Icons.style,
          48           0 :           iconColor: context.colorScheme.secondary,
          49           0 :           onClicked: () {
          50           0 :             OrganizerProvider.of(context)!.toggleExpander(widget.widgetElement);
          51             :           },
          52             :         ),
          53           0 :         if (widget.widgetElement.isExpanded) ..._buildStories(widget.level + 1),
          54             :       ],
          55             :     );
          56             :   }
          57             : }

Generated by: LCOV version 1.15