Skip to content

Commit

Permalink
修复 自定义的值在brn内部进行合并导致 被默认值覆盖的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
alan committed Dec 5, 2024
1 parent eac8fed commit 7ad7735
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 74 deletions.
19 changes: 19 additions & 0 deletions example/lib/sample/components/tabbar/brn_tab_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ class _BrnTabExampleState extends State<BrnTabExample>
_createTopTabbarCountWidgets(),
Divider(),
_createOriginWidgets(),
Divider(),
_buildTabar(),
Container(
child: Container(
height: 200,
color: Colors.white,
),
)
],
),
),
Expand All @@ -81,6 +89,17 @@ class _BrnTabExampleState extends State<BrnTabExample>
});
}

_buildTabar(){
return TabBar(tabs: [
Text("dataaa"),
Text("dBBB"),
Text("CC"),
Text("CC"),
Text("CC"),
],controller:
TabController(length: 5, vsync: this),);
}

_createExpandedMoreTabbarWidgets() {
var tabs = <BadgeTab>[];
tabs.add(BadgeTab(text: "业务一"));
Expand Down
10 changes: 5 additions & 5 deletions lib/src/theme/configs/brn_abnormal_state_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ class BrnAbnormalStateConfig extends BrnBaseConfig {
BrnAbnormalStateConfig merge(BrnAbnormalStateConfig? other) {
if (other == null) return this;
return copyWith(
titleTextStyle: titleTextStyle.merge(other._titleTextStyle),
contentTextStyle: contentTextStyle.merge(other._contentTextStyle),
operateTextStyle: operateTextStyle.merge(other._operateTextStyle),
titleTextStyle: _titleTextStyle?.merge(other._titleTextStyle),
contentTextStyle: _contentTextStyle?.merge(other._contentTextStyle),
operateTextStyle: _operateTextStyle?.merge(other._operateTextStyle),
btnRadius: other._btnRadius,
singleTextStyle: singleTextStyle.merge(other._singleTextStyle),
doubleTextStyle: doubleTextStyle.merge(other._doubleTextStyle),
singleTextStyle: _singleTextStyle?.merge(other._singleTextStyle),
doubleTextStyle: _doubleTextStyle?.merge(other._doubleTextStyle),
singleMinWidth: other._singleMinWidth,
doubleMinWidth: other._doubleMinWidth,
);
Expand Down
16 changes: 8 additions & 8 deletions lib/src/theme/configs/brn_action_sheet_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ class BrnActionSheetConfig extends BrnBaseConfig {
BrnActionSheetConfig merge(BrnActionSheetConfig? other) {
if (other == null) return this;
return copyWith(
titleStyle: titleStyle.merge(other._titleStyle),
itemTitleStyle: itemTitleStyle.merge(other._itemTitleStyle),
itemTitleStyleLink: itemTitleStyleLink.merge(other._itemTitleStyleLink),
titleStyle: _titleStyle?.merge(other._titleStyle),
itemTitleStyle: _itemTitleStyle?.merge(other._itemTitleStyle),
itemTitleStyleLink: _itemTitleStyleLink?.merge(other._itemTitleStyleLink),
itemTitleStyleAlert:
itemTitleStyleAlert.merge(other._itemTitleStyleAlert),
itemDescStyle: itemDescStyle.merge(other._itemDescStyle),
itemDescStyleLink: itemDescStyleLink.merge(other._itemDescStyleLink),
itemDescStyleAlert: itemDescStyleAlert.merge(other._itemDescStyleAlert),
cancelStyle: cancelStyle.merge(other._cancelStyle),
_itemTitleStyleAlert?.merge(other._itemTitleStyleAlert),
itemDescStyle: _itemDescStyle?.merge(other._itemDescStyle),
itemDescStyleLink: _itemDescStyleLink?.merge(other._itemDescStyleLink),
itemDescStyleAlert: _itemDescStyleAlert?.merge(other._itemDescStyleAlert),
cancelStyle: _cancelStyle?.merge(other._cancelStyle),
topRadius: other._topRadius,
contentPadding: other._contentPadding,
titlePadding: other._titlePadding,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/theme/configs/brn_appbar_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ class BrnAppBarConfig extends BrnBaseConfig {
backgroundColor: other._backgroundColor,
appBarHeight: other._appBarHeight,
leadIconBuilder: other._leadIconBuilder,
titleStyle: titleStyle.merge(other._titleStyle),
actionsStyle: actionsStyle.merge(other._actionsStyle),
titleStyle: _titleStyle?.merge(other._titleStyle),
actionsStyle: _actionsStyle?.merge(other._actionsStyle),
titleMaxLength: other._titleMaxLength,
leftAndRightPadding: other._leftAndRightPadding,
itemSpacing: other._itemSpacing,
Expand Down
10 changes: 5 additions & 5 deletions lib/src/theme/configs/brn_card_title_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ class BrnCardTitleConfig extends BrnBaseConfig {
return copyWith(
cardTitlePadding: other._cardTitlePadding,
titleWithHeightTextStyle:
titleWithHeightTextStyle.merge(other._titleWithHeightTextStyle),
titleTextStyle: titleTextStyle.merge(other._titleTextStyle),
subtitleTextStyle: subtitleTextStyle.merge(other._subtitleTextStyle),
detailTextStyle: detailTextStyle.merge(other._detailTextStyle),
accessoryTextStyle: accessoryTextStyle.merge(other._accessoryTextStyle),
_titleWithHeightTextStyle?.merge(other._titleWithHeightTextStyle),
titleTextStyle: _titleTextStyle?.merge(other._titleTextStyle),
subtitleTextStyle: _subtitleTextStyle?.merge(other._subtitleTextStyle),
detailTextStyle: _detailTextStyle?.merge(other._detailTextStyle),
accessoryTextStyle: _accessoryTextStyle?.merge(other._accessoryTextStyle),
alignment: other._alignment,
cardBackgroundColor: other._cardBackgroundColor,
);
Expand Down
10 changes: 5 additions & 5 deletions lib/src/theme/configs/brn_dialog_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -447,21 +447,21 @@ class BrnDialogConfig extends BrnBaseConfig {
iconPadding: other._iconPadding,
titlePaddingSm: other._titlePaddingSm,
titlePaddingLg: other._titlePaddingLg,
titleTextStyle: titleTextStyle.merge(other._titleTextStyle),
titleTextStyle: _titleTextStyle?.merge(other._titleTextStyle),
titleTextAlign: other._titleTextAlign,
contentPaddingSm: other._contentPaddingSm,
contentPaddingLg: other._contentPaddingLg,
contentTextStyle: contentTextStyle.merge(other._contentTextStyle),
contentTextStyle: _contentTextStyle?.merge(other._contentTextStyle),
contentTextAlign: other._contentTextAlign,
warningPaddingSm: other._warningPaddingSm,
warningPaddingLg: other._warningPaddingLg,
warningTextStyle: warningTextStyle.merge(other._warningTextStyle),
warningTextStyle: _warningTextStyle?.merge(other._warningTextStyle),
warningTextAlign: other._warningTextAlign,
dividerPadding: other._dividerPadding,
mainActionTextStyle:
mainActionTextStyle.merge(other._mainActionTextStyle),
_mainActionTextStyle?.merge(other._mainActionTextStyle),
assistActionsTextStyle:
assistActionsTextStyle.merge(other._assistActionsTextStyle),
_assistActionsTextStyle?.merge(other._assistActionsTextStyle),
mainActionBackgroundColor: other._mainActionBackgroundColor,
assistActionsBackgroundColor: other._assistActionsBackgroundColor,
bottomHeight: other._bottomHeight,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/theme/configs/brn_enhance_number_card_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ class BrnEnhanceNumberCardConfig extends BrnBaseConfig {
runningSpace: other._runningSpace,
itemRunningSpace: other._itemRunningSpace,
dividerWidth: other._dividerWidth,
titleTextStyle: titleTextStyle.merge(other._titleTextStyle),
descTextStyle: descTextStyle.merge(other._descTextStyle),
titleTextStyle: _titleTextStyle?.merge(other._titleTextStyle),
descTextStyle: _descTextStyle?.merge(other._descTextStyle),
);
}
}
20 changes: 10 additions & 10 deletions lib/src/theme/configs/brn_form_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -393,23 +393,23 @@ class BrnFormItemConfig extends BrnBaseConfig {
if (other == null) return this;
return copyWith(
backgroundColor: other._backgroundColor,
titleTextStyle: titleTextStyle.merge(other._titleTextStyle),
subTitleTextStyle: subTitleTextStyle.merge(other._subTitleTextStyle),
errorTextStyle: errorTextStyle.merge(other._errorTextStyle),
hintTextStyle: hintTextStyle.merge(other._hintTextStyle),
contentTextStyle: contentTextStyle.merge(other._contentTextStyle),
titleTextStyle: _titleTextStyle?.merge(other._titleTextStyle),
subTitleTextStyle: _subTitleTextStyle?.merge(other._subTitleTextStyle),
errorTextStyle: _errorTextStyle?.merge(other._errorTextStyle),
hintTextStyle: _hintTextStyle?.merge(other._hintTextStyle),
contentTextStyle: _contentTextStyle?.merge(other._contentTextStyle),
formPadding: other._formPadding,
titlePaddingSm: other._titlePaddingSm,
titlePaddingLg: other._titlePaddingLg,
optionsMiddlePadding: other._optionsMiddlePadding,
subTitlePadding: other._subTitlePadding,
errorPadding: other._errorPadding,
disableTextStyle: disableTextStyle.merge(other._disableTextStyle),
tipsTextStyle: tipsTextStyle.merge(other._tipsTextStyle),
headTitleTextStyle: headTitleTextStyle.merge(other._headTitleTextStyle),
optionTextStyle: optionTextStyle.merge(other._optionTextStyle),
disableTextStyle: _disableTextStyle?.merge(other._disableTextStyle),
tipsTextStyle: _tipsTextStyle?.merge(other._tipsTextStyle),
headTitleTextStyle: _headTitleTextStyle?.merge(other._headTitleTextStyle),
optionTextStyle: _optionTextStyle?.merge(other._optionTextStyle),
optionSelectedTextStyle:
optionSelectedTextStyle.merge(other._optionSelectedTextStyle),
_optionSelectedTextStyle?.merge(other._optionSelectedTextStyle),
);
}
}
14 changes: 7 additions & 7 deletions lib/src/theme/configs/brn_gallery_detail_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -321,19 +321,19 @@ class BrnGalleryDetailConfig extends BrnBaseConfig {
BrnGalleryDetailConfig merge(BrnGalleryDetailConfig? other) {
if (other == null) return this;
return copyWith(
appbarTitleStyle: appbarTitleStyle.merge(other._appbarTitleStyle),
appbarActionStyle: appbarActionStyle.merge(other._appbarActionStyle),
appbarTitleStyle: _appbarTitleStyle?.merge(other._appbarTitleStyle),
appbarActionStyle: _appbarActionStyle?.merge(other._appbarActionStyle),
appbarBackgroundColor: other._appbarBackgroundColor,
appbarConfig: other._appbarConfig,
tabBarUnSelectedLabelStyle:
tabBarUnSelectedLabelStyle.merge(other._tabBarUnSelectedLabelStyle),
tabBarLabelStyle: tabBarLabelStyle.merge(other._tabBarLabelStyle),
_tabBarUnSelectedLabelStyle?.merge(other._tabBarUnSelectedLabelStyle),
tabBarLabelStyle: _tabBarLabelStyle?.merge(other._tabBarLabelStyle),
tabBarBackgroundColor: other._tabBarBackgroundColor,
pageBackgroundColor: other._pageBackgroundColor,
bottomBackgroundColor: other._bottomBackgroundColor,
titleStyle: titleStyle.merge(other._titleStyle),
contentStyle: contentStyle.merge(other._contentStyle),
actionStyle: actionStyle.merge(other._actionStyle),
titleStyle: _titleStyle?.merge(other._titleStyle),
contentStyle: _contentStyle?.merge(other._contentStyle),
actionStyle: _actionStyle?.merge(other._actionStyle),
iconColor: other._iconColor,
);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/theme/configs/brn_pair_info_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ class BrnPairRichInfoGridConfig extends BrnBaseConfig {
rowSpacing: other._rowSpacing,
itemSpacing: other._itemSpacing,
itemHeight: other._itemHeight,
keyTextStyle: keyTextStyle.merge(other._keyTextStyle),
valueTextStyle: valueTextStyle.merge(other._valueTextStyle),
linkTextStyle: linkTextStyle.merge(other._linkTextStyle),
keyTextStyle: _keyTextStyle?.merge(other._keyTextStyle),
valueTextStyle: _valueTextStyle?.merge(other._valueTextStyle),
linkTextStyle: _linkTextStyle?.merge(other._linkTextStyle),
);
}
}
10 changes: 5 additions & 5 deletions lib/src/theme/configs/brn_picker_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ class BrnPickerConfig extends BrnBaseConfig {
if (other == null) return this;
return copyWith(
backgroundColor: other._backgroundColor,
cancelTextStyle: cancelTextStyle.merge(other._cancelTextStyle),
confirmTextStyle: confirmTextStyle.merge(other._confirmTextStyle),
titleTextStyle: titleTextStyle.merge(other._titleTextStyle),
cancelTextStyle: _cancelTextStyle?.merge(other._cancelTextStyle),
confirmTextStyle: _confirmTextStyle?.merge(other._confirmTextStyle),
titleTextStyle: _titleTextStyle?.merge(other._titleTextStyle),
pickerHeight: other._pickerHeight,
titleHeight: other._titleHeight,
itemHeight: other._itemHeight,
itemTextStyle: itemTextStyle.merge(other._itemTextStyle),
itemTextStyle: _itemTextStyle?.merge(other._itemTextStyle),
itemTextSelectedStyle:
itemTextSelectedStyle.merge(other._itemTextSelectedStyle),
_itemTextSelectedStyle?.merge(other._itemTextSelectedStyle),
dividerColor: other._dividerColor,
cornerRadius: other._cornerRadius,
);
Expand Down
32 changes: 16 additions & 16 deletions lib/src/theme/configs/brn_selection_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -540,41 +540,41 @@ class BrnSelectionConfig extends BrnBaseConfig {
BrnSelectionConfig merge(BrnSelectionConfig other) {
return copyWith(
menuNormalTextStyle:
menuNormalTextStyle.merge(other._menuNormalTextStyle),
_menuNormalTextStyle?.merge(other._menuNormalTextStyle),
menuSelectedTextStyle:
menuSelectedTextStyle.merge(other._menuSelectedTextStyle),
_menuSelectedTextStyle?.merge(other._menuSelectedTextStyle),
tagTextStyle: tagNormalTextStyle.merge(other._tagNormalTextStyle),
tagSelectedTextStyle:
tagSelectedTextStyle.merge(other._tagSelectedTextStyle),
_tagSelectedTextStyle?.merge(other._tagSelectedTextStyle),
tagRadius: other._tagRadius,
tagBackgroundColor: other._tagNormalBackgroundColor,
tagSelectedBackgroundColor: other._tagSelectedBackgroundColor,
hintTextStyle: hintTextStyle.merge(other._hintTextStyle),
hintTextStyle: _hintTextStyle?.merge(other._hintTextStyle),
rangeTitleTextStyle:
rangeTitleTextStyle.merge(other._rangeTitleTextStyle),
inputTextStyle: inputTextStyle.merge(other._inputTextStyle),
_rangeTitleTextStyle?.merge(other._rangeTitleTextStyle),
inputTextStyle: _inputTextStyle?.merge(other._inputTextStyle),
itemNormalTextStyle:
itemNormalTextStyle.merge(other._itemNormalTextStyle),
_itemNormalTextStyle?.merge(other._itemNormalTextStyle),
itemSelectedTextStyle:
itemSelectedTextStyle.merge(other._itemSelectedTextStyle),
itemBoldTextStyle: itemBoldTextStyle.merge(other._itemBoldTextStyle),
_itemSelectedTextStyle?.merge(other._itemSelectedTextStyle),
itemBoldTextStyle: _itemBoldTextStyle?.merge(other._itemBoldTextStyle),
deepNormalBgColor: other._deepNormalBgColor,
deepSelectBgColor: other._deepSelectBgColor,
middleNormalBgColor: other._middleNormalBgColor,
middleSelectBgColor: other._middleSelectBgColor,
lightNormalBgColor: other._lightNormalBgColor,
lightSelectBgColor: other._lightSelectBgColor,
resetTextStyle: resetTextStyle.merge(other._resetTextStyle),
resetTextStyle: _resetTextStyle?.merge(other._resetTextStyle),
titleForMoreTextStyle:
titleForMoreTextStyle.merge(other._titleForMoreTextStyle),
optionTextStyle: optionTextStyle.merge(other._optionTextStyle),
moreTextStyle: moreTextStyle.merge(other._moreTextStyle),
_titleForMoreTextStyle?.merge(other._titleForMoreTextStyle),
optionTextStyle: _optionTextStyle?.merge(other._optionTextStyle),
moreTextStyle: _moreTextStyle?.merge(other._moreTextStyle),
flayerNormalTextStyle:
flayerNormalTextStyle.merge(other._flayerNormalTextStyle),
_flayerNormalTextStyle?.merge(other._flayerNormalTextStyle),
flayerSelectedTextStyle:
flayerSelectedTextStyle.merge(other._flayerSelectedTextStyle),
_flayerSelectedTextStyle?.merge(other._flayerSelectedTextStyle),
flayerBoldTextStyle:
flayerBoldTextStyle.merge(other._flayerBoldTextStyle),
_flayerBoldTextStyle?.merge(other._flayerBoldTextStyle),
);
}
}
8 changes: 4 additions & 4 deletions lib/src/theme/configs/brn_tabbar_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,14 @@ class BrnTabBarConfig extends BrnBaseConfig {
tabHeight: other._tabHeight,
indicatorHeight: other._indicatorHeight,
indicatorWidth: other._indicatorWidth,
labelStyle: labelStyle.merge(other._labelStyle),
labelStyle: _labelStyle?.merge(other._labelStyle),
unselectedLabelStyle:
unselectedLabelStyle.merge(other._unselectedLabelStyle),
_unselectedLabelStyle?.merge(other._unselectedLabelStyle),
backgroundColor: other._backgroundColor,
tagNormalTextStyle: tagNormalTextStyle.merge(other._tagNormalTextStyle),
tagNormalTextStyle: _tagNormalTextStyle?.merge(other._tagNormalTextStyle),
tagNormalColor: other._tagNormalBgColor,
tagSelectedTextStyle:
tagSelectedTextStyle.merge(other._tagSelectedTextStyle),
_tagSelectedTextStyle?.merge(other._tagSelectedTextStyle),
tagSelectedColor: other._tagSelectedBgColor,
tagRadius: other._tagRadius,
tagSpacing: other._tagSpacing,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/theme/configs/brn_tag_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ class BrnTagConfig extends BrnBaseConfig {
BrnTagConfig merge(BrnTagConfig? other) {
if (other == null) return this;
return copyWith(
textStyle: tagTextStyle.merge(other._tagTextStyle),
selectTextStyle: selectTagTextStyle.merge(other._selectTagTextStyle),
textStyle: _tagTextStyle?.merge(other._tagTextStyle),
selectTextStyle: _selectTagTextStyle?.merge(other._selectTagTextStyle),
radius: other._tagRadius,
backgroundColor: other._tagBackgroundColor,
selectedBackgroundColor: other._selectedTagBackgroundColor,
Expand Down

0 comments on commit 7ad7735

Please sign in to comment.