getDefaultStyle method

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

Implementation

@override
AntdFormItemStyle getDefaultStyle(
    BuildContext context, AntdTheme theme, AntdMapToken token) {
  var form = AntdFormProvider.ofMaybe(context)?.from;
  var finalLayout = layout ?? form?.layout;
  return AntdFormItemStyle(
      helpIconStyle: AntdIconStyle(
          size: 17,
          color: token.colorText.tertiary,
          bodyStyle: AntdBoxStyle(margin: token.size.xxs.left)),
      extraIconStyle: AntdIconStyle(
        size: 17,
        color: token.colorText.tertiary,
      ),
      feedbackStyle: AntdBoxStyle(
          textStyle: token.font.sm.copyWith(color: token.colorError.text)),
      bodyStyle: const AntdBoxStyle(
        options: AntdTapOptions(
            behavior: HitTestBehavior.translucent, alwaysReceiveTap: true),
      ),
      itemStyle: const AntdBoxStyle(),
      itemFlexStyle: AntdFlexStyle(
        mainAxisSize: MainAxisSize.min,
        crossAxisAlignment: layout == AntdFormLayout.horizontal
            ? CrossAxisAlignment.center
            : CrossAxisAlignment.start,
        mainAxisAlignment: layout == AntdFormLayout.horizontal
            ? MainAxisAlignment.spaceBetween
            : MainAxisAlignment.start,
      ),
      labelStyle: AntdBoxStyle(
          margin: finalLayout == AntdFormLayout.vertical
              ? token.size.xs.bottom
              : token.size.seed.right,
          textStyle:
              token.font.xxl.copyWith(color: token.colorText.tertiary)),
      labelRowStyle: const AntdFlexStyle(
        mainAxisSize: MainAxisSize.min,
      ),
      span: const AntdFormItemSpan(),
      requireStyle: AntdFormItemRequireStyle(color: token.colorError),
      extraRowStyle: const AntdFlexStyle());
}