getDefaultStyle method

  1. @override
AntdSwitchStyle getDefaultStyle(
  1. BuildContext context,
  2. AntdTheme theme,
  3. AntdMapToken token
)
override

Implementation

@override
AntdSwitchStyle getDefaultStyle(
    BuildContext context, AntdTheme theme, AntdMapToken token) {
  var trackStyle = AntdBoxStyle(
      border: token.border.all,
      color: token.colorBgContainer,
      radius: 28.radius.all,
      padding: 4.all);
  var thumbStyle = AntdBoxStyle(
      color: token.colorBgContainer,
      size: 24,
      border: token.border.all,
      radius: 24.radius.all);

  var style = AntdSwitchStyle(
    bodyStyle: const AntdBoxStyle(
        width: 70, options: AntdTapOptions(alwaysReceiveTap: true)),
    trackStyle: trackStyle,
    activeTrackStyle: trackStyle.copyWith(color: token.colorPrimary),
    thumbStyle: thumbStyle,
    activeThumbStyle: thumbStyle,
    contentStyle: AntdBoxStyle(
      textStyle: token.font.md.copyWith(color: token.colorText.tertiary),
    ),
    activeContentStyle: AntdBoxStyle(
      textStyle: token.font.md.copyWith(
        color: token.colorWhite,
      ),
    ),
  );
  return style;
}