Skip to content

Commit

Permalink
Merge branch '3.x' into master
Browse files Browse the repository at this point in the history
* 3.x: (21 commits)
  Update build_test.yml (#348)
  fix: BrnIconButton 传入字体无效问题 (#346)
  add attribute emptyImage (#344)
  增加textInputAction (#337)
  fix BrnToast defaultoffset error (#343)
  fix docs (#342)
  feature: Add BrnSafeDialog (dismiss) instead of Navigator.pop to close the Dialog. (#321)
  BrnBrokenLine: xDial support selected style (#319)
  fix: BrnProgressChart 设置颜色,背景色,以及动画无效 (#326)
  feat: 增加focusNode prop,实现焦点可控 (#328)
  fix: BrnTextSelectFormItem 布局字偏上问题 (#331)
  [perf]: 优化代码:1、将 Container(),Container(width:0, height:0) 替换为 SizedBox.shrink(),2、将 InkWell 替换为 GestureDetector (#325)
  fix #333; (#335)
  Update brn_middle_input_diaolg.dart (#327)
  fix global style BrnCardTitleConfig don't work (#310) (#313)
  fix BrnMultiSelectTagsPicker style error (#316) (#320)
  Update build_test.yml (#323)
  optimize BrnPageLoading fix #295 (#298)
  Create i10n.md
  #fixbug: 修复issues275 (#301)
  ...
  • Loading branch information
violinday committed Sep 30, 2022
2 parents c9273ae + 0a7aeac commit bc98392
Show file tree
Hide file tree
Showing 74 changed files with 768 additions and 400 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@ jobs:
matrix:
os: [macos-latest]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '8.x'
- uses: subosito/flutter-action@v1
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '2.10.5'
flutter-version: '3.3.0'
- run: dart --version
- run: flutter --version
- run: flutter pub get
- run: flutter pub publish --dry-run
- run: cd example; flutter build ios --no-codesign
- run: cd example; pod install --project-directory=./ios; flutter build ios --target=./lib/main.dart --no-codesign

test_android:
name: Test Android on ${{ matrix.os }}
Expand All @@ -40,7 +37,7 @@ jobs:
java-version: '8.x'
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.10.5'
flutter-version: '3.3.0'
- run: dart --version
- run: flutter --version
- run: flutter pub get
Expand Down
Binary file added assets/images/content_failed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/network_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/no_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ group:
# BrnAbnormalStateWidget

## 一、效果总览

![](./img/empty_state_intro.png)

<img src="./img/empty_state_1.png" style="zoom:50%;" /><img src="./img/empty_state_2.png" style="zoom:50%;" /><img src="./img/empty_state_3.png" style="zoom:50%;" /><img src="./img/empty_state_4.png" style="zoom:50%;" /><img src="./img/empty_state_5.png" style="zoom:50%;" />

## 二、描述

Expand Down Expand Up @@ -76,7 +74,7 @@ BrnAbnormalStateWidget({
```dart
BrnAbnormalStateWidget(
img: Image.asset(
'assets/image/empty_state.png',
'assets/image/content_failed.png',
scale: 3.0,
),
isCenterVertical: true,
Expand All @@ -95,13 +93,12 @@ BrnAbnormalStateWidget(

```dart
BrnAbnormalStateWidget(
isCenterVertical: true,
img: Image.asset(
'assets/image/empty_state.png',
scale: 3.0,
),
title: BrnStrings.noData,
)
img: Image.asset(
'assets/image/network_error.png',
scale: 3.0,
),
title: '网络数据异常',
);
```

### 效果 3:大模块空态
Expand All @@ -110,12 +107,12 @@ BrnAbnormalStateWidget(

```dart
BrnAbnormalStateWidget(
img: Image.asset(
'assets/image/empty_state.png',
scale: 3.0,
),
content: '您的门店暂无用户',
)
img: Image.asset(
'assets/image/no_data.png',
scale: 3.0,
),
content: '您的门店暂无用户',
);
```

### 效果 4:单按钮效果
Expand All @@ -124,18 +121,18 @@ BrnAbnormalStateWidget(

```dart
BrnAbnormalStateWidget(
img: Image.asset(
'assets/image/empty_state.png',
scale: 3.0,
),
title: "这是副标题内容这是副标题内容这是副标",
content: '您的门店暂无用户',
operateAreaType: OperateAreaType.SingleButton,
operateTexts: ["切换账号"],
action: (_) {
BrnToast.show("第$_个按钮被点击了", context);
},
)
img: Image.asset(
'assets/image/no_data.png',
scale: 3.0,
),
title: "这是副标题内容这是副标题内容这是副标",
content: '您的门店暂无用户',
operateAreaType: OperateAreaType.singleButton,
operateTexts: ["切换账号"],
action: (_) {
BrnToast.show("第$_个按钮被点击了", context);
},
);
```

### 效果 5:双按钮效果
Expand All @@ -144,16 +141,16 @@ BrnAbnormalStateWidget(

```dart
BrnAbnormalStateWidget(
img: Image.asset(
'assets/image/empty_state.png',
scale: 3.0,
),
title: "暂无",
content: '您还没有在维护的信息哦',
operateAreaType: OperateAreaType.DoubleButton,
operateTexts: ['去添加', '去修改'],
action: (_) {
BrnToast.show("第$_个按钮被点击了", context);
},
)
img: Image.asset(
'assets/image/no_data.png',
scale: 3.0,
),
title: "暂无",
content: '您还没有在维护的信息哦',
operateAreaType: OperateAreaType.doubleButton,
operateTexts: ['去添加', '去修改'],
action: (_) {
BrnToast.show("第$_个按钮被点击了", context);
},
);
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ BrnSingleSelectCityPage({
this.showSearchBar = true,
this.locationText = '',
this.onValueChanged,
this.emptyImage,
});
```

Expand All @@ -39,50 +40,59 @@ BrnSingleSelectCityPage({

| **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** |
| --- | --- | --- | --- | --- |
| appBarTitle | String | 导航栏标题 || "" |
| hotCityTitle | String | 热门推荐标题 || "" |
| appBarTitle | String? | 导航栏标题 || "" |
| hotCityTitle | String? | 热门推荐标题 || "" |
| showSearchBar | bool | 是否展示searchBar || |
| locationText | String | 当前定位城市文案 || "" |
| cityList | `List<CityInfo>` | 城市列表 || |
| onValueChanged | ValueChanged | 点击时间 || |
| hotCityList | `List<CityInfo>` | 热门推荐城市列表 || |
| cityList | `List<BrnSelectCityModel>?` | 城市列表 || |
| onValueChanged | ValueChanged<BrnSelectCityModel>? | 点击时间 || |
| hotCityList | `List<BrnSelectCityModel>?` | 热门推荐城市列表 || |
| emptyImage | `Image?` | 暂无搜索结果页面占位图 || |

### 其它数据


```dart
///页面标题
final String appBarTitle;
///热门推荐标题
final String hotCityTitle;
///是否 展示searchBar true
final bool showSearchBar;
///当前城市定位文案展示
final String locationText;
///城市列表
List<CityInfo> cityList;
///热门推荐城市列表
List<CityInfo> hotCityList;
/// 单选项 点击的回调
final ValueChanged<CityInfo> onValueChanged;
/// 页面标题,默认空
final String? appBarTitle;
/// 热门推荐标题,默认空
final String? hotCityTitle;
/// 是否展示searchBar,默认 true
final bool showSearchBar;
/// 当前城市定位文案展示
final String locationText;
/// 城市列表
final List<BrnSelectCityModel>? cityList;
/// 热门推荐城市列表
final List<BrnSelectCityModel> hotCityList;
/// 单选项 点击的回调
final ValueChanged<BrnSelectCityModel>? onValueChanged;
/// 空页面中间展位图展示
final Image? emptyImage;
///城市信息
CityInfo {
//城市名称
String name;
//城市名称前这是的标记符号
String tagIndex;
//拼音
String namePinyin;
//唯一标记
String tag;
BrnSelectCityModel {
/// 城市名称
String name = "";
/// 城市名称前这是的标记符号
String tagIndex = "";
/// 拼音
String? namePinyin;
String tag = "";
/// 城市编码
String cityCode = "";
}
```

Expand All @@ -94,21 +104,19 @@ BrnSingleSelectCityPage({
<img src="./img/BrnSingleSelectCityPageDemo1.png" style="zoom: 33%;" />

```dart
List<CityInfo> hotCityList = List();
hotCityList.addAll([
CityInfo(name: "北京市"),
CityInfo(name: "广州市"),
CityInfo(name: "成都市"),
CityInfo(name: "深圳市"),
CityInfo(name: "杭州市"),
CityInfo(name: "武汉市"),
]);
BrnSingleSelectCityPage(
appBarTitle: '城市单选',
hotCityTitle: '这里是推荐城市',
hotCityList: hotCityList,
cityList: hotCityList,
);
List<BrnSelectCityModel> hotCityList = [];
hotCityList.addAll([
BrnSelectCityModel(name: "北京市"),
BrnSelectCityModel(name: "广州市"),
BrnSelectCityModel(name: "成都市"),
BrnSelectCityModel(name: "深圳市"),
BrnSelectCityModel(name: "杭州市"),
BrnSelectCityModel(name: "武汉市"),
]);
return BrnSingleSelectCityPage(
appBarTitle: '城市单选',
hotCityTitle: '这里是推荐城市',
hotCityList: hotCityList,
);
```
Binary file added example/assets/image/content_failed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/assets/image/network_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/assets/image/no_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ class _BrokenLineExampleState extends State<BrokenLineExample> {
showPointDashLine: true,
yHintLineOffset: 30,
isTipWindowAutoDismiss: false,
isShowXDial: true,
lines: [
BrnPointsLine(
isShowPointText: true,
isShowXDial: true,
isShowXDial: false,
lineWidth: 3,
pointRadius: 4,
isShowPoint: true,
Expand Down Expand Up @@ -325,31 +326,37 @@ class _BrokenLineExampleState extends State<BrokenLineExample> {
BrnDialItem(
dialText: '1月',
dialTextStyle: TextStyle(fontSize: 12.0, color: Color(0xFF999999)),
selectedDialTextStyle: TextStyle(fontSize: 14.0, color: Colors.green),
value: 1,
),
BrnDialItem(
dialText: '2月',
dialTextStyle: TextStyle(fontSize: 12.0, color: Color(0xFF999999)),
selectedDialTextStyle: TextStyle(fontSize: 14.0, color: Colors.red),
value: 2,
),
BrnDialItem(
dialText: '3月',
dialTextStyle: TextStyle(fontSize: 12.0, color: Color(0xFF999999)),
selectedDialTextStyle: TextStyle(fontSize: 14.0, color: Colors.black),
value: 3,
),
BrnDialItem(
dialText: '5月',
dialTextStyle: TextStyle(fontSize: 12.0, color: Color(0xFF999999)),
selectedDialTextStyle: TextStyle(fontSize: 14.0, color: Colors.orange),
value: 5,
),
BrnDialItem(
dialText: '6月',
dialTextStyle: TextStyle(fontSize: 12.0, color: Color(0xFF999999)),
selectedDialTextStyle: TextStyle(fontSize: 14.0, color: Colors.yellow),
value: 6,
),
BrnDialItem(
dialText: '7月',
dialTextStyle: TextStyle(fontSize: 12.0, color: Color(0xFF999999)),
selectedDialTextStyle: TextStyle(fontSize: 14.0, color: Colors.amberAccent),
value: 7,
)
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';

Expand All @@ -25,13 +23,17 @@ class ProgressChartExampleState extends State<ProgressChartExample> {
height: 44,
),
BrnProgressChart(
key: UniqueKey(),
width: 200,
width: 300,
height: 20,
value: count,
duration: Duration(milliseconds: 500),
colors: [Colors.lightBlueAccent, Colors.blue],
backgroundColor: Colors.grey,
showAnimation: true,
isFromLastValue: true,
brnProgressIndicatorBuilder: (BuildContext context, double value) {
return Text(
'自定义文本:$value',
'自定义:$value',
style: TextStyle(color: Colors.white),
);
},
Expand All @@ -48,6 +50,7 @@ class ProgressChartExampleState extends State<ProgressChartExample> {
value: count,
divisions: 10,
onChanged: (data) {
if (!mounted) return;
setState(() {
count = data;
});
Expand Down
Loading

0 comments on commit bc98392

Please sign in to comment.