LCOV - code coverage report
Current view: top level - src/widgets - zoom_handle.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 1 31 3.2 %
Date: 2021-10-03 15:54:23 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:flutter/material.dart';
       2             : import 'package:widgetbook/src/providers/zoom_provider.dart';
       3             : import '../utils/extensions.dart';
       4             : 
       5             : class ZoomHandle extends StatefulWidget {
       6          10 :   const ZoomHandle({Key? key}) : super(key: key);
       7             : 
       8           0 :   @override
       9           0 :   _ZoomHandleState createState() => _ZoomHandleState();
      10             : }
      11             : 
      12             : class _ZoomHandleState extends State<ZoomHandle> {
      13           0 :   @override
      14             :   Widget build(BuildContext context) {
      15           0 :     var state = ZoomProvider.of(context)!.state;
      16           0 :     return Row(
      17           0 :       children: [
      18           0 :         TextButton(
      19           0 :           onPressed: ZoomProvider.of(context)!.zoomOut,
      20           0 :           style: TextButton.styleFrom(
      21             :             splashFactory: InkRipple.splashFactory,
      22             :             shape:
      23           0 :                 RoundedRectangleBorder(borderRadius: BorderRadius.circular(90)),
      24             :             minimumSize: Size.zero,
      25             :             padding: const EdgeInsets.all(12),
      26             :           ),
      27           0 :           child: Icon(
      28             :             Icons.remove,
      29           0 :             color: context.theme.hintColor,
      30             :           ),
      31             :         ),
      32             :         const SizedBox(width: 8),
      33           0 :         Row(
      34           0 :           children: [
      35           0 :             SizedBox(
      36             :               width: 50,
      37           0 :               child: Text(
      38           0 :                 state.zoomLevel.toStringAsFixed(2),
      39           0 :                 style: context.theme.textTheme.subtitle2!.copyWith(
      40             :                   fontSize: 20,
      41             :                 ),
      42             :               ),
      43             :             ),
      44             :             const SizedBox(
      45             :               width: 4,
      46             :             ),
      47             :             const Text('zoom'),
      48             :           ],
      49             :         ),
      50             :         const SizedBox(width: 8),
      51           0 :         TextButton(
      52           0 :           onPressed: ZoomProvider.of(context)!.zoomIn,
      53           0 :           style: TextButton.styleFrom(
      54             :             splashFactory: InkRipple.splashFactory,
      55             :             shape:
      56           0 :                 RoundedRectangleBorder(borderRadius: BorderRadius.circular(90)),
      57             :             minimumSize: Size.zero,
      58             :             padding: const EdgeInsets.all(12),
      59             :           ),
      60           0 :           child: Icon(
      61             :             Icons.add,
      62           0 :             color: context.theme.hintColor,
      63             :           ),
      64             :         ),
      65             :         const SizedBox(width: 8),
      66           0 :         TextButton(
      67           0 :           onPressed: ZoomProvider.of(context)!.resetToNormal,
      68           0 :           style: TextButton.styleFrom(
      69             :             splashFactory: InkRipple.splashFactory,
      70             :             shape:
      71           0 :                 RoundedRectangleBorder(borderRadius: BorderRadius.circular(90)),
      72             :             minimumSize: Size.zero,
      73             :             padding: const EdgeInsets.all(12),
      74             :           ),
      75           0 :           child: Icon(
      76             :             Icons.replay,
      77           0 :             color: context.theme.hintColor,
      78             :           ),
      79             :         ),
      80             :       ],
      81             :     );
      82             :   }
      83             : }

Generated by: LCOV version 1.15