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

              Line data    Source code
           1             : import 'package:flutter/cupertino.dart';
           2             : import 'package:flutter/material.dart';
           3             : import 'package:widgetbook/src/constants/radii.dart';
           4             : import 'package:widgetbook/src/models/app_info.dart';
           5             : import 'package:widgetbook/src/models/organizers/organizers.dart';
           6             : import 'package:widgetbook/src/providers/theme_provider.dart';
           7             : import 'package:widgetbook/src/widgets/header.dart';
           8             : import 'package:widgetbook/src/widgets/search_bar.dart';
           9             : import 'package:widgetbook/src/widgets/tiles/category_tile.dart';
          10             :
          11             : class NavigationPanel extends StatefulWidget {
          12           0 :   const NavigationPanel({
          13             :     Key? key,
          14             :     required this.appInfo,
          15             :     required this.categories,
          16           0 :   }) : super(key: key);
          17             :
          18             :   final AppInfo appInfo;
          19             :   final List<Category> categories;
          20             :
          21           0 :   @override
          22           0 :   _NavigationPanelState createState() => _NavigationPanelState();
          23             : }
          24             :
          25             : class _NavigationPanelState extends State<NavigationPanel> {
          26             :   final ScrollController controller = ScrollController();
          27             :   Story? selectedComponent;
          28             :
          29             :   final TextEditingController search = TextEditingController();
          30             :   String query = '';
          31             :
          32           0 :   Widget _buildCategory(BuildContext context, int i) {
          33           0 :     final item = widget.categories[i];
          34           0 :     return CategoryTile(category: item);
          35             :   }
          36             :
          37           0 :   @override
          38             :   Widget build(BuildContext context) {
          39           0 :     return Container(
          40             :       constraints: const BoxConstraints(minWidth: 50, maxWidth: 400),
          41           0 :       child: Column(
          42             :         crossAxisAlignment: CrossAxisAlignment.start,
          43           0 :         children: [
          44           0 :           Header(
          45           0 :             appInfo: widget.appInfo,
          46             :           ),
          47             :           const SizedBox(
          48             :             height: 16,
          49             :           ),
          50           0 :           SearchBar(
          51           0 :             theme: ThemeProvider.of(context)!.state,
          52             :           ),
          53             :           const SizedBox(
          54             :             height: 16,
          55             :           ),
          56           0 :           Expanded(
          57           0 :             child: Container(
          58           0 :               decoration: BoxDecoration(
          59           0 :                 color: Theme.of(context).colorScheme.surface,
          60             :                 borderRadius: Radii.defaultRadius,
          61             :               ),
          62             :               padding: const EdgeInsets.all(16),
          63           0 :               child: Builder(
          64           0 :                 builder: (context) {
          65           0 :                   return ListView.separated(
          66           0 :                     controller: controller,
          67             :                     physics: const AlwaysScrollableScrollPhysics(),
          68           0 :                     itemCount: widget.categories.length,
          69           0 :                     itemBuilder: _buildCategory,
          70             :                     padding: const EdgeInsets.only(bottom: 8),
          71           0 :                     separatorBuilder: (context, index) =>
          72             :                         const SizedBox(height: 8),
          73             :                   );
          74             :                 },
          75             :               ),
          76             :             ),
          77             :           ),
          78             :         ],
          79             :       ),
          80             :     );
          81             :   }
          82             : }

Generated by: LCOV version 1.15