FSwitchStyle.inherit constructor

FSwitchStyle.inherit({
  1. required FColorScheme colorScheme,
  2. required FStyle style,
})

Creates a FSwitchStyle that inherits its properties from colorScheme.

Implementation

FSwitchStyle.inherit({required FColorScheme colorScheme, required FStyle style})
    : this(
        focusColor: colorScheme.primary,
        labelLayoutStyle: FLabelStyles.inherit(style: style).horizontalStyle.layout,
        enabledStyle: FSwitchStateStyle(
          checkedColor: colorScheme.primary,
          uncheckedColor: colorScheme.border,
          thumbColor: colorScheme.background,
          labelTextStyle: style.enabledFormFieldStyle.labelTextStyle,
          descriptionTextStyle: style.enabledFormFieldStyle.descriptionTextStyle,
        ),
        disabledStyle: FSwitchStateStyle(
          checkedColor: colorScheme.disable(colorScheme.primary),
          uncheckedColor: colorScheme.disable(colorScheme.border),
          thumbColor: colorScheme.background,
          labelTextStyle: style.disabledFormFieldStyle.labelTextStyle,
          descriptionTextStyle: style.disabledFormFieldStyle.descriptionTextStyle,
        ),
        errorStyle: FSwitchErrorStyle(
          labelTextStyle: style.errorFormFieldStyle.labelTextStyle,
          descriptionTextStyle: style.errorFormFieldStyle.descriptionTextStyle,
          errorTextStyle: style.errorFormFieldStyle.errorTextStyle,
        ),
      );