LCOV - code coverage report
Current view: top level - theme - inputs.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 25 35 71.4 %
Date: 2022-07-13 09:29:13 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:basf_flutter_components/basf_flutter_components.dart';
       2             : import 'package:flutter/material.dart';
       3             : 
       4             : /// A collection of Input values being used in the BASF themes
       5             : abstract class BasfInputThemes {
       6             :   const BasfInputThemes._();
       7             : 
       8             :   /// Focused border color
       9             :   static const MaterialColor focusedBorderColor = BasfColors.grey;
      10             : 
      11             :   /// Main input theme
      12           1 :   static InputDecorationTheme get mainInputDecorationTheme {
      13           1 :     return InputDecorationTheme(
      14           1 :       enabledBorder: _enabledBorder,
      15           1 :       focusedBorder: _focusedBorder,
      16           1 :       errorBorder: _errorBorder,
      17           1 :       focusedErrorBorder: _errorBorder,
      18           1 :       disabledBorder: _disabledBorder,
      19             :       contentPadding: const EdgeInsets.symmetric(horizontal: 15),
      20             :       iconColor: focusedBorderColor,
      21             :       prefixIconColor: focusedBorderColor,
      22             :       suffixIconColor: focusedBorderColor,
      23           2 :       hintStyle: BasfThemes.mainTextTheme.subtitle1!
      24           2 :           .copyWith(color: focusedBorderColor.shade400),
      25             :     );
      26             :   }
      27             : 
      28             :   /// Error input theme
      29           0 :   static ThemeData errorInputTheme(ThemeData theme) => theme.copyWith(
      30           0 :         textSelectionTheme: _errorTextSelectionTheme,
      31             :         iconTheme: const IconThemeData(color: BasfColors.red),
      32           0 :         hintColor: BasfColors.red.shade400,
      33           0 :         inputDecorationTheme: theme.inputDecorationTheme.copyWith(
      34           0 :           hintStyle: theme.inputDecorationTheme.hintStyle
      35           0 :               ?.copyWith(color: BasfColors.red.shade400),
      36             :         ),
      37             :       );
      38             : 
      39             :   /// Disabled input theme
      40           2 :   static ThemeData disabledInputTheme(ThemeData theme) => theme.copyWith(
      41           2 :         iconTheme: IconThemeData(color: BasfColors.grey.shade400),
      42           1 :         hintColor: BasfColors.grey.shade400,
      43           2 :         inputDecorationTheme: theme.inputDecorationTheme.copyWith(
      44           2 :           hintStyle: theme.inputDecorationTheme.hintStyle
      45           0 :               ?.copyWith(color: BasfColors.grey.shade400),
      46           1 :           fillColor: BasfColors.grey.shade100,
      47             :           filled: true,
      48             :         ),
      49             :       );
      50             : 
      51           0 :   static final TextSelectionThemeData _errorTextSelectionTheme =
      52           0 :       TextSelectionThemeData(
      53             :     cursorColor: BasfColors.red,
      54             :     selectionHandleColor: BasfColors.red,
      55           0 :     selectionColor: BasfColors.red.shade200,
      56             :   );
      57             : 
      58           3 :   static final OutlineInputBorder _focusedBorder = OutlineInputBorder(
      59             :     borderSide: const BorderSide(color: focusedBorderColor),
      60           1 :     borderRadius: BasfThemes.defaultBorderRadius,
      61             :   );
      62             : 
      63           3 :   static final OutlineInputBorder _enabledBorder = OutlineInputBorder(
      64           2 :     borderSide: BorderSide(color: focusedBorderColor.shade300),
      65           1 :     borderRadius: BasfThemes.defaultBorderRadius,
      66             :   );
      67             : 
      68           3 :   static final OutlineInputBorder _disabledBorder = OutlineInputBorder(
      69           2 :     borderSide: BorderSide(color: BasfColors.grey.shade300),
      70           1 :     borderRadius: BasfThemes.defaultBorderRadius,
      71             :   );
      72             : 
      73           3 :   static final OutlineInputBorder _errorBorder = OutlineInputBorder(
      74             :     borderSide: const BorderSide(color: BasfColors.red),
      75           1 :     borderRadius: BasfThemes.defaultBorderRadius,
      76             :   );
      77             : }

Generated by: LCOV version 1.16