getDefaultStyle method

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

Implementation

@override
AntdPopoverStyle getDefaultStyle(
    BuildContext context, AntdTheme theme, AntdMapToken token) {
  var color = mode == AntdPopoverMode.light
      ? token.colorBgContainer
      : token.colorBgSpotlight;
  var textStyle = token.font.md.copyWith(
      color:
          mode == AntdPopoverMode.light ? token.colorText : token.colorWhite);
  var action = actions != null && builder == null;
  return AntdPopoverStyle(
      childStyle:
          const AntdBoxStyle(options: AntdTapOptions(alwaysReceiveTap: true)),
      actionStyle: AntdPopoverActionStyle(
        bodyStyle: AntdBoxStyle(
            textStyle: token.font.md.copyWith(
                color:
                    mode == AntdPopoverMode.dark ? token.colorWhite : null),
            border: (mode == AntdPopoverMode.dark
                    ? token.border.copyWith(color: token.colorWhite)
                    : token.border)
                .bottom,
            padding: token.size.lg.vertical.marge(token.size.lg.right)),
        iconStyle: AntdIconStyle(
            color: mode == AntdPopoverMode.dark
                ? token.colorWhite
                : token.colorText,
            size: 20,
            bodyStyle: AntdBoxStyle(margin: token.size.seed.right)),
      ),
      actionColumnStyle: const AntdFlexStyle(
        mainAxisSize: MainAxisSize.min,
        crossAxisAlignment: CrossAxisAlignment.stretch,
      ),
      popoverBoxStyle: AntdPopoverBoxStyle(
        bodyStyle: AntdBoxStyle(shadows: token.shadow.primary),
        childStyle: AntdBoxStyle(
            color: color,
            textStyle: textStyle,
            radius: token.radius.all,
            padding: action
                ? token.size.lg.left
                : token.size.seed.vertical.marge(token.size.lg.horizontal)),
        arrowStyle: AntdArrowStyle(
            size: const Size(15, 8), color: color, bluntness: 1),
      ),
      animation:
          const AntdPopoverAnimation(duration: Duration(milliseconds: 400)));
}