LCOV - code coverage report
Current view: top level - src/widgets - theme_handle.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 1 12 8.3 %
Date: 2021-10-28 11:30:47 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:flutter/material.dart';
       2             : import 'package:widgetbook/src/providers/theme_provider.dart';
       3             : import 'package:widgetbook/src/utils/extensions.dart';
       4             : 
       5             : class ThemeHandle extends StatelessWidget {
       6          15 :   const ThemeHandle({Key? key}) : super(key: key);
       7             : 
       8           0 :   @override
       9             :   Widget build(BuildContext context) {
      10           0 :     final themeProvider = ThemeProvider.of(context)!;
      11           0 :     return Tooltip(
      12             :       message: 'Toggle theme',
      13           0 :       child: TextButton(
      14           0 :         onPressed: themeProvider.toggleTheme,
      15           0 :         style: TextButton.styleFrom(
      16             :           splashFactory: InkRipple.splashFactory,
      17             :           shape:
      18           0 :               RoundedRectangleBorder(borderRadius: BorderRadius.circular(90)),
      19             :           minimumSize: Size.zero,
      20             :           padding: const EdgeInsets.all(12),
      21             :         ),
      22           0 :         child: Icon(
      23             :           Icons.dark_mode,
      24           0 :           color: themeProvider.state == ThemeMode.light
      25           0 :               ? context.theme.hintColor
      26           0 :               : context.colorScheme.primary,
      27             :         ),
      28             :       ),
      29             :     );
      30             :   }
      31             : }

Generated by: LCOV version 1.15