LCOV - code coverage report
Current view: top level - src/widgets - device_bar.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 1 24 4.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/providers/device_provider.dart';
       4             : import 'package:widgetbook/src/utils/extensions.dart';
       5             : import 'package:widgetbook/src/widgets/device_item.dart';
       6             : 
       7             : class DeviceBar extends StatelessWidget {
       8          14 :   const DeviceBar({Key? key}) : super(key: key);
       9             : 
      10           0 :   @override
      11             :   Widget build(BuildContext context) {
      12           0 :     final deviceProvider = DeviceProvider.of(context)!;
      13           0 :     final state = deviceProvider.state;
      14           0 :     return Row(
      15           0 :       children: [
      16             :         const Text('Device'),
      17             :         const SizedBox(
      18             :           width: 12,
      19             :         ),
      20           0 :         TextButton(
      21           0 :           onPressed: deviceProvider.previousDevice,
      22           0 :           style: TextButton.styleFrom(
      23             :             splashFactory: InkRipple.splashFactory,
      24             :             shape:
      25           0 :                 RoundedRectangleBorder(borderRadius: BorderRadius.circular(90)),
      26             :             minimumSize: Size.zero,
      27             :             padding: const EdgeInsets.all(12),
      28             :           ),
      29           0 :           child: Icon(
      30             :             Icons.chevron_left,
      31           0 :             color: context.theme.hintColor,
      32             :           ),
      33             :         ),
      34           0 :         ListView.separated(
      35             :           shrinkWrap: true,
      36             :           scrollDirection: Axis.horizontal,
      37           0 :           itemBuilder: (context, index) {
      38           0 :             return DeviceItem(
      39           0 :               device: state.availableDevices[index],
      40             :             );
      41             :           },
      42           0 :           separatorBuilder: (context, index) {
      43             :             return const SizedBox(
      44             :               width: 8,
      45             :             );
      46             :           },
      47           0 :           itemCount: state.availableDevices.length,
      48             :         ),
      49           0 :         TextButton(
      50           0 :           onPressed: deviceProvider.nextDevice,
      51           0 :           style: TextButton.styleFrom(
      52             :             splashFactory: InkRipple.splashFactory,
      53             :             shape:
      54           0 :                 RoundedRectangleBorder(borderRadius: BorderRadius.circular(90)),
      55             :             minimumSize: Size.zero,
      56             :             padding: const EdgeInsets.all(12),
      57             :           ),
      58           0 :           child: Icon(
      59             :             Icons.chevron_right,
      60           0 :             color: context.theme.hintColor,
      61             :           ),
      62             :         ),
      63             :       ],
      64             :     );
      65             :   }
      66             : }

Generated by: LCOV version 1.15