initThemeConfig method

  1. @override
void initThemeConfig(
  1. String configId, {
  2. BaseCommonConfig? currentLevelCommonConfig,
})
override

cardTitleConfig 获取逻辑详见 BrnThemeConfigurator.getConfig 方法

Implementation

@override
void initThemeConfig(
  String configId, {
  BaseCommonConfig? currentLevelCommonConfig,
}) {
  super.initThemeConfig(
    configId,
    currentLevelCommonConfig: currentLevelCommonConfig,
  );

  CardTitleConfig cardTitleConfig =
      BaseThemeConfig.instance.getConfig(configId: configId).cardTitleConfig;

  _cardBackgroundColor ??= commonConfig.fillBase;
  _cardTitlePadding ??= EdgeInsets.only(
    left: cardTitleConfig.cardTitlePadding.left,
    top: commonConfig.vSpacingXl,
    right: cardTitleConfig.cardTitlePadding.right,
    bottom: commonConfig.vSpacingMd,
  );
  _titleWithHeightTextStyle = cardTitleConfig.titleWithHeightTextStyle.merge(
    BaseTextStyle(
      color: commonConfig.colorTextBase,
      fontSize: commonConfig.fontSizeHead,
    ).merge(_titleWithHeightTextStyle),
  );
  _titleTextStyle = cardTitleConfig.titleTextStyle.merge(
    BaseTextStyle(
      color: commonConfig.colorTextBase,
      fontSize: commonConfig.fontSizeHead,
    ).merge(_titleTextStyle),
  );
  _subtitleTextStyle = cardTitleConfig.subtitleTextStyle.merge(
    BaseTextStyle(
      color: commonConfig.colorTextBase,
      fontSize: commonConfig.fontSizeBase,
    ).merge(_subtitleTextStyle),
  );
  _accessoryTextStyle = cardTitleConfig.accessoryTextStyle.merge(
    BaseTextStyle(
      color: commonConfig.colorTextSecondary,
      fontSize: commonConfig.fontSizeHead,
    ).merge(_accessoryTextStyle),
  );
  _detailTextStyle = cardTitleConfig.detailTextStyle.merge(
    BaseTextStyle(
      color: commonConfig.colorTextBase,
      fontSize: commonConfig.fontSizeBase,
    ).merge(_detailTextStyle),
  );
  _alignment ??= cardTitleConfig._alignment;
}