Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoujuanjuan committed Sep 13, 2023
2 parents 8cb1e88 + 07d7c5e commit 27695e1
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 14 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## [3.4.3] - 2023-9-13

### Changed

#### base

- Fixed the problem that some component documents cannot be viewed [#495](https://github.com/LianjiaTech/bruno/issues/495).

#### components

- <code>BrnPopupWindow</code> : fixed issue [#486](https://github.com/LianjiaTech/bruno/issues/486) which is called after initState and whenever the dependencies change thereafter.
- <code>BrnTabBar</code>: fixed the issue [#487](https://github.com/LianjiaTech/bruno/issues/487) of invalid setting of badge.
- <code>BrnStepInputFormItem</code>: fixed the situation where manually input numbers are preceded by 0 [#458](https://github.com/LianjiaTech/bruno/issues/458).



## [3.4.2] - 2023-8-23

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const BrnSingleSelectDialog(
| title | String | 弹窗标题名称 || "" |
| messageText | String? | 描述文案,优先级较 messageWidget 低,优先使用 messageWidget || |
| messageWidget | Widget? | 描述 Widget || |
| conditions | List<String> | 备选项数组 || |
| conditions | `List<String>` | 备选项数组 || |
| checkedItem | String | 选中的选项名称 || |
| submitText | String? | 确定/提交 按钮文案 || 默认值为国际化配置文本 '提交' |
| submitBgColor | Color | 提交按钮背景颜色 || |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ BrnMultiDataPickerWidget(
| titleTextStyle | TextStyle? | 标题样式 || |
| confirmTextStyle | TextStyle? | 确认文案样式 || |
| cancelTextStyle | TextStyle? | 取消文案样式 || |
| pickerTitles | List<String>? | 多级数据选择每一级的默认标题 |||
| pickerTitles | `List<String>?` | 多级数据选择每一级的默认标题 |||
| pickerTitleFontSize | double? | 多级数据选择每一级默认标题的字体大小 || 16 |
| pickerTitleColor | Color? | 多级数据选择每一级默认标题的文案颜色 || Color(0XFF4A4E59) |
| textFontSize | double? | 多级数据选择数据字体大小 || 18 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ BrnSelectionView(

| **参数名** | **参数类型** | **作用** | **是否必填** | **默认值** |
| -------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------ | ---------- |
| originalSelectionData | List<**BrnSelectionEntity**> | 筛选所需数据用于展示筛选菜单栏,以及展开的筛选弹窗。 |||
| originalSelectionData | `List<**BrnSelectionEntity**>` | 筛选所需数据用于展示筛选菜单栏,以及展开的筛选弹窗。 |||
| selectionViewController | BrnSelectionViewController? | 用于主动控制筛选弹窗的关闭和刷新菜单的内容状态 || |
| onSelectionChanged | `void Function(int menuIndex, Map<String, String> selectedParams, Map<String, String> customParams, BrnSetCustomSelectionMenuTitle setCustomMenuTitle)` | 点击筛选弹窗中的【确认】按钮时回调给外部选中的参数,包括:<br />menuIndex:当前展开的 menu 位置;<br />selectedParams 所有筛选弹窗中选中的参数;<br />customParams:拦截 CustomHandle 类型的筛选并设置的自定义参数;setCustomMenuTitle:对当前的筛选 Menu 设置 title 和高亮的回调函数,一般与 customParams 、**onCustomSelectionMenuClick**搭配使用,例如,通过 onCustomSelectionMenuClick 回调返回 customParams 参数,setCustomMenuTitle 根据 customParams 参数判断是否高亮,是否需要根据参数更新筛选菜单的 Title。 || |
| configRowCount | `BrnConfigTagCountPerRow(int index, BrnSelectionEntity entity)?` | 仅适用于类型为 SelectionWindowType.Range 的筛选弹窗,用于对 SelectionWindowType.Range 类型的列数做配置,回调参数为 menu 的所在位置 index 和 menu 的数据。 |||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,14 @@ class RangeLimitedTextInputFormatter extends TextInputFormatter {
return const TextEditingValue(
text: '', selection: TextSelection.collapsed(offset: 0));
} else if (newNum != null && minValue <= newNum && newNum <= maxValue) {
return newValue;
/// perf issue:#458,eg. '020' should displayed as '20'
if (newNum.toString() != newValue.text) {
return TextEditingValue(
text: newNum.toString(),
selection: TextSelection.collapsed(offset: newNum.toString().length));
} else {
return newValue;
}
} else {
return oldValue;
}
Expand Down
3 changes: 2 additions & 1 deletion lib/src/components/popup/brn_popup_window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:bruno/src/constants/brn_asset_constants.dart';
import 'package:bruno/src/theme/brn_theme_configurator.dart';
import 'package:bruno/src/utils/brn_text_util.dart';
import 'package:bruno/src/utils/brn_tools.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

/// popup window 位于 targetView 的方向
Expand Down Expand Up @@ -192,7 +193,7 @@ class _BrnPopupWindowState extends State<BrnPopupWindow> {
void initState() {
super.initState();
this._showRect = _getWidgetGlobalRect(widget.popKey);
this._screenSize = View.of(context).physicalSize / View.of(context).devicePixelRatio;
this._screenSize =PlatformDispatcher.instance.views.first.physicalSize/ PlatformDispatcher.instance.views.first.devicePixelRatio;
_borderColor = (widget.borderColor ?? Colors.transparent).withAlpha(255);
_backgroundColor =
(widget.backgroundColor ?? Colors.transparent).withAlpha(255);
Expand Down
18 changes: 10 additions & 8 deletions lib/src/components/tabbar/normal/brn_tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ class BrnTabBarState extends State<BrnTabBar> {
late double _largeSize;

/// 小红点上偏移量
double _paddingTop = 0;
double _dy = 0;

/// 小红点右偏移量
double _paddingRight = 0;
double _dx = 0;

/// 展开更多的按钮宽度
final double _moreSpacing = 50;
Expand Down Expand Up @@ -408,7 +408,8 @@ class BrnTabBarState extends State<BrnTabBar> {
color: Color(0xFFFFFFFF), fontSize: 10, height: 1),
),
backgroundColor: Colors.red,
alignment: AlignmentDirectional(_paddingRight, _paddingTop),
alignment: Alignment.topLeft,
offset:Offset(_dx,_dy) ,
padding: _badgePadding,
largeSize: _largeSize,
child: Text(
Expand Down Expand Up @@ -483,7 +484,8 @@ class BrnTabBarState extends State<BrnTabBar> {
style: TextStyle(
color: Color(0xFFFFFFFF), fontSize: 10, height: 1),
),
alignment: AlignmentDirectional(_paddingRight, _paddingTop),
alignment: Alignment.topLeft,
offset: Offset(_dx,_dy),
padding: _badgePadding,
largeSize: _largeSize,
child: Text(badgeTab.text!,
Expand Down Expand Up @@ -512,7 +514,7 @@ class BrnTabBarState extends State<BrnTabBar> {

/// 计算小红点尺寸相关参数
void caculateBadgeParams(BadgeTab badgeTab, BoxConstraints constraints) {
_paddingTop = -5.0;
_dy = -5.0;

if (badgeTab.badgeNum != null) {
if (badgeTab.badgeNum! < 10) {
Expand All @@ -537,7 +539,7 @@ class BrnTabBarState extends State<BrnTabBar> {
_badgePadding = EdgeInsets.only(left: 4.0, right: 4.0);
_largeSize = 8.0;
_badgeText = "";
_paddingTop = 1.0;
_dy = 1.0;
}
}

Expand Down Expand Up @@ -574,10 +576,10 @@ class BrnTabBarState extends State<BrnTabBar> {
// if(_badgeWidth > (constraints.maxWidth + _labelPadding.right)){
// _paddingRight = 0.0;
// }else{
_paddingRight = constraints.maxWidth + _labelPadding.right - _badgeWidth;
_dx = constraints.maxWidth + _labelPadding.right - _badgeWidth;
// }
} else {
_paddingRight = _tabTextWidth;
_dx = _tabTextWidth;
}
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: bruno
description: An enterprise-class package of Flutter components for mobile applications.
version: 3.4.2
version: 3.4.3
homepage: https://bruno.ke.com/
repository: https://github.com/LianjiaTech/bruno
issue_tracker: https://github.com/LianjiaTech/bruno/issues
Expand Down

0 comments on commit 27695e1

Please sign in to comment.