Skip to content

Commit

Permalink
migrate docs to null-safety (#112)
Browse files Browse the repository at this point in the history
* Null safe (#13)

* remove useless comments

* remove useless dependencies

* adapt brn_expandable_text.dart null-safe

* upgrade dependencies:collection to stable

* migrate constants to null safety

* migrate brn_multi_click_util to null safety

* migrate font util to null safety

* migrate brn_text_style to null safety

* migrate brn picker constants to null safety

* migrate brn appBar theme to null safety

* optimize bruno theme's import (#16)

* ♻️  [NNBD] Part 1. Migrate configs (#28)

* ♻️ [NNBD] Part 2. Migrate utils (#30)

* ♻️ Migrate utils to NNBD

* 🎨 Improve the color getter

* 🎨 BrnSearchText (#36)

* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null

* refactor:优化theme,暴露非null引用

* theme:去除无用信息及优化部分代码

* theme:增加属性类型

* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null (#40)

* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null

* refactor:优化theme,暴露非null引用

* theme:去除无用信息及优化部分代码

* theme:增加属性类型

* 🎨 utils-EventBus添加null-safe (#23)

* 🎨 utils-EventBus添加null-safe

* 🎨 修改theme配置功能及utils/brn_tools工具函数 null-safe

* 🎨 EventBus添加null-safe(其他提交请忽略,输入回退)

Co-authored-by: 大脸儿 <[email protected]>

* refactor brn_toast (#33)

* refactor brn_toast

* refactor brn_toast

* 优化修复 EventBus

* 优化 EventBus  单例实现 (#43)

* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null

* refactor:优化theme,暴露非null引用

* theme:去除无用信息及优化部分代码

* theme:增加属性类型

* 优化修复 EventBus

* brn_toast time change to seconds (#45)

* migrate brn_loading to null safety (#32)

* migrate brn_loading to null safety

* mv loading content to brnString constants

* optimization brn_theme_configurator instance constructor (#47)

* 迁移example ,优化常量命名,增加export

* migrate brn_empty_status.dart

* Migrate BrnStateTag、BrnTagCustom、BrnSelectTag、BrnDeleteTag to null-safe (#46)

* [null-safe]: BrnStateTag、BrnTagCustom、BrnSelectTag、BrnDeleteTag 空安全适配

* perf: BrnDeleteTag null-safe

* 删除 BrnThemeImg

* fix:tagConfig merge方法增加判空处理

* fix:revert tagConfig

* fix:BrnAbnormalStateWidget空处理

* reset and migrated package [rating] to null-safety. (#42)

* 迁移example ,优化常量命名,增加export (#51)

* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null

* refactor:优化theme,暴露非null引用

* theme:去除无用信息及优化部分代码

* theme:增加属性类型

* 优化修复 EventBus

* 迁移example ,优化常量命名,增加export

* migrate brn_empty_status.dart

* 删除 BrnThemeImg

* fix:tagConfig merge方法增加判空处理

* fix:revert tagConfig

* fix:BrnAbnormalStateWidget空处理

* 空安全报错修改 (#55)

* 空安全报错修改

* 优化sketch教程为视频教程

* Migrated  package [selectcity] to null-safety (#56)

* reset and migrated package [rating] to null-safety.

* Migrated package [selectcity] to null-safety

* 修改ISuspensionBean抽象类相关子类的空字段问题。

* Migrated package [noticebar] to null-safety

* migrate card_title to null safety (#59)

* migrate card_title to null-safety

* [fix] brn_action_card_title: _sub widget is not null

* [optimize] empty widget use SizedBox instead of Container

* replace empty widget SizedBox to SizedBox.shrink

* Migrated package [radio] to null-safety (#62)

* reset and migrated package [rating] to null-safety.

* Migrated package [selectcity] to null-safety

* 修改ISuspensionBean抽象类相关子类的空字段问题。

* Migrated package [noticebar] to null-safety

* 1.Migrated package [radio] to null-safety;
2.Modified not-need-nullable param in brn_single_select_city_page.dart;

* Migrated tabbar to null-safety

* Migrated package [guide] to null-safety (#65)

* reset and migrated package [rating] to null-safety.

* Migrated package [selectcity] to null-safety

* 修改ISuspensionBean抽象类相关子类的空字段问题。

* Migrated package [noticebar] to null-safety

* 1.Migrated package [radio] to null-safety;
2.Modified not-need-nullable param in brn_single_select_city_page.dart;

* Migrated package [guide] to null-safety

* 🚀 Use the latest Podfile for the example (#68)

* Null safe calendar (#64)

* migrate calendar widget to null safety

* brn_calendar_view fix _currentStartSelectedDate is not null

* brn_calendar_view: simplify borderRadius usage

* calendar widget late _displayMode

* calendar widget add two constructors with date change

* Card Components Null safe adapter (#53)

* feat: support fvm

* feat: Card components null-safey adpater

* refactor: make code simple and clean

* refactor: make code simple and clean

* Migrated scroll_anchor to null-safety

* fix #71 (#77)

* fix content_card themeData is not null (#79)

* Null safe of all buttons (#20)

* icon button 增加null safe

* null safe for normal button

* null safe for normal button

* null safe for button

* null safe for all button

* merge

* rebase

* rebase

* merge

* optimization

* GlobalKey is not null

* optimization

* reset popup window

* showButtonPanelPopList

Co-authored-by: foreturn <[email protected]>

* Migrated package [navbar][input] to null-safety (#75)

* reset and migrated package [rating] to null-safety.

* Migrated package [selectcity] to null-safety

* 修改ISuspensionBean抽象类相关子类的空字段问题。

* Migrated package [noticebar] to null-safety

* 1.Migrated package [radio] to null-safety;
2.Modified not-need-nullable param in brn_single_select_city_page.dart;

* Migrated package [guide] to null-safety

* Migrated package [navbar][input] to null-safety

* Optimized codes in brn_appbar.dart

* Restore partial modification

* fix:修复迁移tabar问题

* Migrated tabbar & scroll_anchor to null-safety (#66)

* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null

* refactor:优化theme,暴露非null引用

* theme:去除无用信息及优化部分代码

* theme:增加属性类型

* 优化修复 EventBus

* 迁移example ,优化常量命名,增加export

* migrate brn_empty_status.dart

* 删除 BrnThemeImg

* fix:tagConfig merge方法增加判空处理

* fix:revert tagConfig

* fix:BrnAbnormalStateWidget空处理

* Migrated tabbar to null-safety

* Migrated scroll_anchor to null-safety

* fix:修复迁移tabar问题

* Migrate Selection to null-safe (#54)

* [null-safe]: BrnStateTag、BrnTagCustom、BrnSelectTag、BrnDeleteTag 空安全适配

* perf: BrnDeleteTag null-safe

* Migrate Selection to null-safe

* Migrate Selection to null-safe

* perf:  ItemEntity name 字段的初始化

* Migrate Selection to null-safe

* migrate form to null safety

* fix:修复tabbar报错及selection警告信息

* Migrated package [dialog] to null-safety (#81)

* reset and migrated package [rating] to null-safety.

* Migrated package [selectcity] to null-safety

* 修改ISuspensionBean抽象类相关子类的空字段问题。

* Migrated package [noticebar] to null-safety

* 1.Migrated package [radio] to null-safety;
2.Modified not-need-nullable param in brn_single_select_city_page.dart;

* Migrated package [guide] to null-safety

* Migrated package [navbar][input] to null-safety

* Optimized codes in brn_appbar.dart

* Restore partial modification

* Migrated package [dialog] to null-safety

* Modified some params's default value or  nullable type

* migrate brn_horizontal_steps、brn_step_line to null safety (#89)

* migrate charts to null safety (#80)

* migrate DoughuntChart to null safety

* migrate progress bar chart to null safety

* update progress bar chart document

* migrate progress chart to null safety

* migrate radar chart to null safety

* migrate funnel chart to null safety

* migrate broken line chart to null safety

* fix progress bar chart some value is required

* fix progress bar chart some value is required

* fix brn_line_paint _path is not null

* fix brn_funnel_chart properties is not null

* fix brn_radar_chart properties is not null

* fix brn_line_painter not null values

* fix brn_progress_bar_chart error

* brn_broken_line some properties is not null value

* replace empty Container to SizedBox.shrink

* update progress_bar_chart null safety value by hand

* update broken_line null safety values by hand

* update funnel_chart null safety value by hand

* make LineCanvasModel immutable

* migrate actionsheet into null-safe (#73)

* migrate actionsheet into null-safe

* sheet: code review

Co-authored-by: yuanjunliang <[email protected]>

* fix:修复迁移问题

* fix:优化迁移部分问题key和style非空问题

* migrate form to null safety (#86)

* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null

* refactor:优化theme,暴露非null引用

* theme:去除无用信息及优化部分代码

* theme:增加属性类型

* 优化修复 EventBus

* 迁移example ,优化常量命名,增加export

* migrate brn_empty_status.dart

* 删除 BrnThemeImg

* fix:tagConfig merge方法增加判空处理

* fix:revert tagConfig

* fix:BrnAbnormalStateWidget空处理

* Migrated tabbar to null-safety

* Migrated scroll_anchor to null-safety

* fix:修复迁移tabar问题

* migrate form to null safety

* fix:修复tabbar报错及selection警告信息

* fix:修复迁移问题

* fix:优化迁移部分问题key和style非空问题

* migrate picker to null safety

* migrate popup to null safety (#69)

* migrate popup to null safety

* fix MeasureSize null safe problems

* fix popup migrate to null-safety review problems

* migrate gallery to null safety (#90)

* migrate gallery to null safety

* change the type error

* remove @

* change String? to String

* fix:修复picker空安全迁移问题

* migrate appraise dir to null safety (#84)

* migrate appraise dir to null safety

* fix appraise migrate to null-safety review problems

* fix:修复list没指定泛型及if判断错误问题

* fix:migrate dashed line to null safty

* migrate picker to null safety (#91)

* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null

* refactor:优化theme,暴露非null引用

* theme:去除无用信息及优化部分代码

* theme:增加属性类型

* 优化修复 EventBus

* 迁移example ,优化常量命名,增加export

* migrate brn_empty_status.dart

* 删除 BrnThemeImg

* fix:tagConfig merge方法增加判空处理

* fix:revert tagConfig

* fix:BrnAbnormalStateWidget空处理

* Migrated tabbar to null-safety

* Migrated scroll_anchor to null-safety

* fix:修复迁移tabar问题

* migrate form to null safety

* fix:修复tabbar报错及selection警告信息

* fix:修复迁移问题

* fix:优化迁移部分问题key和style非空问题

* migrate picker to null safety

* fix:修复picker空安全迁移问题

* fix:修复list没指定泛型及if判断错误问题

* fix:migrate dashed line to null safty

* migrate example to null safty

* fix:修复部分example warning

* fix:修复demo报错问题

* fix:追加未跟踪修复

* fix:优化部分接口可空参数为非空

* Perf:Button Null safe (#93)

* perf: Migrate Button Null-Safe

* perf:优化 HorizontalStep Null-Safe

* fix: null exception when parse json to entity

* perf Button Null-Safe,
fix NullException
perf  more layer  icon  color when item selected

* migrate example to null safety (#94)

* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null

* refactor:优化theme,暴露非null引用

* theme:去除无用信息及优化部分代码

* theme:增加属性类型

* 优化修复 EventBus

* 迁移example ,优化常量命名,增加export

* migrate brn_empty_status.dart

* 删除 BrnThemeImg

* fix:tagConfig merge方法增加判空处理

* fix:revert tagConfig

* fix:BrnAbnormalStateWidget空处理

* Migrated tabbar to null-safety

* Migrated scroll_anchor to null-safety

* fix:修复迁移tabar问题

* migrate form to null safety

* fix:修复tabbar报错及selection警告信息

* fix:修复迁移问题

* fix:优化迁移部分问题key和style非空问题

* migrate picker to null safety

* fix:修复picker空安全迁移问题

* fix:修复list没指定泛型及if判断错误问题

* fix:migrate dashed line to null safty

* migrate example to null safty

* fix:修复部分example warning

* fix:修复demo报错问题

* fix:追加未跟踪修复

* fix:优化部分接口可空参数为非空

Co-authored-by: violinday <[email protected]>

* fix:修复tabar showmore overflow 问题 #98 以及 tabbar 标签颜色默认设置倒置问题

* Fix #98 问题及优化部分代码 (#99)

* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null

* refactor:优化theme,暴露非null引用

* theme:去除无用信息及优化部分代码

* theme:增加属性类型

* 优化修复 EventBus

* 迁移example ,优化常量命名,增加export

* migrate brn_empty_status.dart

* 删除 BrnThemeImg

* fix:tagConfig merge方法增加判空处理

* fix:revert tagConfig

* fix:BrnAbnormalStateWidget空处理

* Migrated tabbar to null-safety

* Migrated scroll_anchor to null-safety

* fix:修复迁移tabar问题

* migrate form to null safety

* fix:修复tabbar报错及selection警告信息

* fix:修复迁移问题

* fix:优化迁移部分问题key和style非空问题

* migrate picker to null safety

* fix:修复picker空安全迁移问题

* fix:修复list没指定泛型及if判断错误问题

* fix:migrate dashed line to null safty

* migrate example to null safty

* fix:修复部分example warning

* fix:修复demo报错问题

* fix:追加未跟踪修复

* fix:优化部分接口可空参数为非空

* fix:修复tabar showmore overflow 问题 #98 以及 tabbar 标签颜色默认设置倒置问题

Co-authored-by: violinday <[email protected]>

* refactor:优化 BrnInputItemType 常量命名

* refactor:优化枚举值命名

* fix:修改docs目录下form相关常量命名及所有枚举命名

* 优化 BrnInputItemType 常量命名 (#100)

* Theme: 优化单例实现,初步优化 BrnAllThemeConfig 属性获取不为 null

* refactor:优化theme,暴露非null引用

* theme:去除无用信息及优化部分代码

* theme:增加属性类型

* 优化修复 EventBus

* 迁移example ,优化常量命名,增加export

* migrate brn_empty_status.dart

* 删除 BrnThemeImg

* fix:tagConfig merge方法增加判空处理

* fix:revert tagConfig

* fix:BrnAbnormalStateWidget空处理

* Migrated tabbar to null-safety

* Migrated scroll_anchor to null-safety

* fix:修复迁移tabar问题

* migrate form to null safety

* fix:修复tabbar报错及selection警告信息

* fix:修复迁移问题

* fix:优化迁移部分问题key和style非空问题

* migrate picker to null safety

* fix:修复picker空安全迁移问题

* fix:修复list没指定泛型及if判断错误问题

* fix:migrate dashed line to null safty

* migrate example to null safty

* fix:修复部分example warning

* fix:修复demo报错问题

* fix:追加未跟踪修复

* fix:优化部分接口可空参数为非空

* fix:修复tabar showmore overflow 问题 #98 以及 tabbar 标签颜色默认设置倒置问题

* refactor:优化 BrnInputItemType 常量命名

* refactor:优化枚举值命名

* fix:修改docs目录下form相关常量命名及所有枚举命名

Co-authored-by: violinday <[email protected]>

* refactor: 更新 changelog

* refactor:BrnBubbleText 增加属性 bgColor、textStyle,修复demo  actionSheet、gallery、selection、picker错误

* fix:修复changelog 错误,brn_gallery_summary_page.dart 中标题空处理

* fix:修复部分问题

* fix:修复部分问题

* migrate docs to null-safety

* feat:changelog 增加 BrnHorizontalStepsManager 改动

* fix:优化changelog

Co-authored-by: laiiihz <[email protected]>
Co-authored-by: LAIIIHZ <[email protected]>
Co-authored-by: Alex Li <[email protected]>
Co-authored-by: kalifun <[email protected]>
Co-authored-by: kkkman22 <[email protected]>
Co-authored-by: 大脸儿 <[email protected]>
Co-authored-by: leftcoding <[email protected]>
Co-authored-by: violinday <[email protected]>
Co-authored-by: jojinshallar <[email protected]>
Co-authored-by: HappyImp <[email protected]>
Co-authored-by: Kenneth <[email protected]>
Co-authored-by: donywan <[email protected]>
Co-authored-by: foreturn <[email protected]>
Co-authored-by: Junl <[email protected]>
Co-authored-by: yuanjunliang <[email protected]>
Co-authored-by: Nayuta403 <[email protected]>
  • Loading branch information
17 people committed Mar 9, 2022
1 parent 045a2d6 commit f18f1e3
Show file tree
Hide file tree
Showing 43 changed files with 972 additions and 999 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Add build test thank to **AlexV525**.

#### components
- **Breaking change**: remove <code>BrnHorizontalStepsManager</code> and put function <code>forwardStep()</code> <code>backStep()</code> into <code>BrnStepsController</code> thanks to leftcoding.
- <code>BrnCalendarView</code>: add <code>BrnCalendarView.single()</code> and <code>BrnCalendarView.range()</code> constructor and had its argument <code>startEndDateChange</code> removed.
- <code>BrnSelectionEntityListBean</code>: <code>fromMap</code> is renamed to <code>fromJson</code>.
- <code>BrnRadioButton</code>: optimize click area [#31](https://github.com/LianjiaTech/bruno/pull/31) , thanks to **a1017480401** .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,25 @@ group:

```dart
const BrnBottomButtonPanel(
{Key key,
@required this.mainButtonName,
@required this.mainButtonOnTap,
this.secondaryButtonName,
this.secondaryButtonOnTap,
this.enableMainButton = true,
this.enableSecondaryButton = true,
this.iconButtonList})
: super(key: key);
{Key? key,
required this.mainButtonName,
required this.mainButtonOnTap,
this.secondaryButtonName,
this.secondaryButtonOnTap,
this.enableMainButton = true,
this.enableSecondaryButton = true,
this.iconButtonList})
: super(key: key);
```
### 参数说明

| 参数名 | 参数类型 | 描述 | 是否必填 | 默认值 |
| --- | --- | --- | --- | --- |
| mainButtonName | String | 主按钮的显示文案 || '' |
| mainButtonName | String | 主按钮的显示文案 || |
| mainButtonOnTap | VoidCallback | 主按钮的点击回调 |||
| secondaryButtnoName | String | 次按钮显示文案 || '' |
| secondaryButtonOnTap | VoidCallback | 次按钮的点击回调 |||
| iconButtonList | List | icon按钮的集合 |||
| secondaryButtonName | String? | 次按钮显示文案 || |
| secondaryButtonOnTap | VoidCallback? | 次按钮的点击回调 |||
| iconButtonList | List<BrnVerticalIconButton>? | icon按钮的集合 |||
| enableMainButton | bool | 主按钮是否可用 || true |
| enableSecondaryButton | bool | 次按钮是否可用 || true |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ group:
### 构造函数

```dart
BrnMultipleBottomButton(
{Key key,
this.mainButtonName,
this.subButtonName,
this.onSelectAllTap,
this.onMainButtonTap,
this.onSelectedButtonTap,
this.onSubButtonTap,
this.hasArrow = false,
this.bottomController})
const BrnMultipleBottomButton(
{Key? key,
this.mainButton,
this.subButton,
this.onMainButtonTap,
this.onSubButtonTap,
this.onSelectedButtonTap,
this.onSelectAll,
this.hasArrow = false,
this.bottomController})
: super(key: key);
```


Expand All @@ -47,13 +48,13 @@ BrnMultipleBottomButton(
| **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** |
| --- | --- | --- | --- | --- |
| mainButton | dynamic | 主按钮的显示文案,传入String即使用默认的Text样式,传入其他样式则使用对应的Widget || |
| onMainButtonTap | VoidCallback | 主按钮点击回调 || |
| onMainButtonTap | VoidCallback? | 主按钮点击回调 || |
| subButton | dynamic | 次按钮的显示文案,传入String即使用默认的Text样式,传入其他样式则使用对应的Widget || |
| onSubButtonTap | VoidCallback | 次按钮点击回调 || |
| onSelectedButtonTap | Function(int) | selectedButtonOnTap', '点击已选的回调,存在三种状态:-1:不可展开(当value为0的时候),0:收起,1:展开 || |
| onSelectAll | Function(bool) | 全选的点击回调,不传则不展示多选按钮,回传参数true表示选中全选,false表示取消全选 || |
| onSubButtonTap | VoidCallback? | 次按钮点击回调 || |
| onSelectedButtonTap | Function(BrnMultipleButtonArrowState)? | selectedButtonOnTap', '点击已选的回调,存在三种状态:-1:不可展开(当value为0的时候),0:收起,1:展开 || |
| onSelectAll | void Function(bool?)? | 全选的点击回调,不传则不展示多选按钮,回传参数true表示选中全选,false表示取消全选 || |
| hasArrow | bool | 已选侧边是否需要小箭头 || false |
| bottomController | BrnMultipleBottomController | 暴露给外界设置按钮状态的控制器 || |
| bottomController | BrnMultipleBottomController? | 暴露给外界设置按钮状态的控制器 || |



Expand Down
20 changes: 10 additions & 10 deletions docs/components/buttonPanel/BrnButtonPanel/BrnButtonPanel.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ group:

```dart
const BrnButtonPanel(
{Key key,
@required this.mainButtonName,
@required this.mainButtonOnTap,
this.isMainBtnEnable = true,
this.secondaryButtonNameList,
this.secondaryButtonOnTap,
this.secondaryButtonList,
this.horizontalPadding = 20,
this.popDirection = BrnPopupDirection.bottom})
: super(key: key);
{Key? key,
required this.mainButtonName,
required this.mainButtonOnTap,
this.isMainBtnEnable = true,
this.secondaryButtonNameList,
this.secondaryButtonOnTap,
this.secondaryButtonList,
this.horizontalPadding = 20,
this.popDirection = BrnPopupDirection.bottom})
: super(key: key);
```
### 参数说明

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ group:
### 构造函数

```dart
BrnTextButtonPanel(
{Key key,
@required this.nameList,
this.onTap,
this.popDirection = BrnPopupDirection.bottom})
: super(key: key);
const BrnTextButtonPanel({
Key? key,
required this.nameList,
this.onTap,
this.popDirection = BrnPopupDirection.bottom,
}) : super(key: key);
```
### 参数说明

Expand Down
92 changes: 47 additions & 45 deletions docs/components/charts/BrnBrokenLine/BrnBrokenLine.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ group:

```dart
BrnBrokenLine({
Key key,
@required this.size,
@required this.lines,
Key? key,
required this.size,
required this.lines,
this.contentPadding = const EdgeInsets.only(left: 10, right: 10),
this.backgroundColor,
this.xyDialLineWidth = 2,
Expand All @@ -44,8 +44,8 @@ BrnBrokenLine({
this.xDialMin,
this.xDialMax,
this.xDialValues,
this.yDialMin,
this.yDialMax,
required this.yDialMin,
required this.yDialMax,
this.yDialValues,
this.isShowXHintLine = true,
this.isShowYHintLine = false,
Expand All @@ -54,36 +54,42 @@ BrnBrokenLine({
this.isTipWindowAutoDismiss = true,
this.isShowXDialText = false,
this.isShowYDialText = false,
})
}) : super(key: key) {
// 设置自定义 X 轴时,检查 x轴的最大、最小刻度范围
if (xDialValues != null) {
assert(xDialMin != null);
assert(xDialMax != null);
}
}
```

### 参数说明:

| 参数名 | 参数类型 | 作用 | 是否必填 | 默认值 | 备注 |
| ---------------------- | --------------------- | ------------------------------------------------------------------- | -------- | ------ | ---- |
| size | Size | 表格宽高 | | | |
| lines | `List<BrnPointsLine>` | 要绘制的折线集合 | | | |
| contentPadding | EdgeInsets | 图标内容区域 padding(不包含坐标轴) || | |
| backgroundColor | Color | 绘制表格的背景色 | | | |
| xyDialLineWidth | double | xy 轴线条的宽度 | | 2 | |
| xDialColor | Color | x 轴的颜色 | | | |
| yDialColor | Color | y 轴的颜色 | | | |
| yHintLineOffset | double | Y 轴辅助线向右偏移量,默认 20(X 轴刻度线也会跟随该偏移量向右偏移) || 20 | |
| showPointDashLine | bool | 是否展示数据点选中时的辅助线 | | true | |
| dialWidth | double | Y 轴刻度的宽度,和 X 轴刻度的高度 | | 4 | |
| xDialMin | double | X 轴展示范围最小值 | | 0 | |
| xDialMax | double | X 轴展示范围最大值 | | 1 | |
| yDialMin | double | Y 轴展示范围最小值 | | 0 | |
| yDialMax | double | Y 轴展示范围最大值 | | 1 | |
| xDialValues | `List<BrnDialItem>` | X 轴刻度数据 | | | |
| yDialValues | `List<BrnDialItem>` | Y 轴刻度数据 | | | |
| isShowXHintLine | bool | 是否展示 X 轴辅助线 | | true | |
| isShowYHintLine | bool | 是否展示 Y 轴辅助线 | | false | |
| isHintLineSolid | bool | 辅助线是否为虚线 | | true | |
| hintLineColor | Color | 辅助线颜色 | | | |
| isTipWindowAutoDismiss | bool | 点击弹出的 tip 提示框,是否自动消失 | | true | |
| isShowXDialText | bool | 是否展示 X 坐标刻度文案 | | false | |
| isShowYDialText | bool | 是否展示 Y 坐标刻度文案 | | false | |
| 参数名 | 参数类型 | 作用 | 是否必填 | 默认值 | 备注 |
| ---------------------- | --------------------- | ------------------------------------------------------------ | -------- | ------------------------------------ | ---- |
| size | Size | 表格宽高 | | | |
| lines | `List<BrnPointsLine>` | 要绘制的折线集合 | | | |
| contentPadding | EdgeInsets | 图标内容区域 padding(不包含坐标轴) || EdgeInsets.only(left: 10, right: 10) | |
| backgroundColor | Color | 绘制表格的背景色 | | | |
| xyDialLineWidth | double | xy 轴线条的宽度 | | 2 | |
| xDialColor | Color | x 轴的颜色 | | | |
| yDialColor | Color | y 轴的颜色 | | | |
| yHintLineOffset | double | Y 轴辅助线向右偏移量,默认 20(X 轴刻度线也会跟随该偏移量向右偏移) || 20.0 | |
| showPointDashLine | bool | 是否展示数据点选中时的辅助线 | | true | |
| dialWidth | double | Y 轴刻度的宽度,和 X 轴刻度的高度 | | 4 | |
| xDialMin | double | X 轴展示范围最小值 | | | |
| xDialMax | double | X 轴展示范围最大值 | | | |
| yDialMin | double | Y 轴展示范围最小值 | | | |
| yDialMax | double | Y 轴展示范围最大值 | | | |
| xDialValues | `List<BrnDialItem>` | X 轴刻度数据 | | | |
| yDialValues | `List<BrnDialItem>`| Y 轴刻度数据 | | | |
| isShowXHintLine | bool | 是否展示 X 轴辅助线 | | true | |
| isShowYHintLine | bool | 是否展示 Y 轴辅助线 | | false | |
| isHintLineSolid | bool | 辅助线是否为虚线 | | true | |
| hintLineColor | Color | 辅助线颜色 | | | |
| isTipWindowAutoDismiss | bool | 点击弹出的 tip 提示框,是否自动消失 | | true | |
| isShowXDialText | bool | 是否展示 X 坐标刻度文案 | | false | |
| isShowYDialText | bool | 是否展示 Y 坐标刻度文案 | | false | |

### 其他数据结构

Expand All @@ -101,15 +107,14 @@ class BrnPointData {
Offset offset;
/// 点要展示的内容
String pointText;
String? pointText;
/// 点展示内容样式
TextStyle pointTextStyle;
TextStyle? pointTextStyle;
/// 折线节点的点击击事件是否可用
bool isClickable;
/// 每个点的点击行为配置数据
BrnLineTouchData lineTouchData;
}
```
Expand All @@ -119,19 +124,16 @@ class BrnPointData {
```
class BrnLineTouchData {
/// 用于临时存储要展示 tip 内容在坐标的位置
double x, y;
double? x, y;
/// 要展示 tip 的相对偏移量
Offset tipOffset;
/// 要展示的 tip 的宽高
Size tipWindowSize;
/// 折线节点点击事件是否可用
bool enabled;
/// 点击回调,由于返回 展示内容(String 或 Widget)
Function() onTouch;
Function()? onTouch;
}
```

Expand All @@ -147,22 +149,22 @@ class BrnPointsLine {
double lineWidth;
/// Line渐变色,从曲线到x轴从上到下的闭合颜色集
List<Color> shaderColors;
List<Color>? shaderColors;
/// 曲线或折线的颜色
Color lineColor;
/// 点外圈的颜色
Color pointColor;
Color? pointColor;
/// 点的外半径参数
double pointRadius;
/// 点内圈的颜色
Color pointInnerColor;
Color? pointInnerColor;
/// 点内圈的半径
double pointInnerRadius;
double? pointInnerRadius;
/// 是否显示x轴的文字,用来处理多个线条绘制的时候,同一x轴坐标不需要绘制多次,则只需要将多条线中一个标记绘制即可
bool isShowXDial;
Expand All @@ -183,10 +185,10 @@ class BrnPointsLine {
```dart
class BrnDialItem {
/// 刻度标志内容
String dialText;
String? dialText;
/// 刻度标志样式
TextStyle dialTextStyle;
TextStyle? dialTextStyle;
/// x,y 轴刻度值。用于刻度在坐标的真实定位
double value;
Expand Down
38 changes: 20 additions & 18 deletions docs/components/charts/BrnDoughnutChart/BrnDoughnutChart.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,39 @@ group:

```dart
BrnDoughnutChart(
{this.width = 0,
this.height = 0,
this.padding = EdgeInsets.zero,
this.ringWidth = 50,
this.data,
this.fontSize = 12,
this.fontColor = Colors.white,
this.selectedItem,
this.showTitleWhenSelected = false,
this.brnDoughnutSelectCallback});
{this.width = 0,
this.height = 0,
this.padding = EdgeInsets.zero,
this.ringWidth = 50,
required this.data,
this.fontSize = 12,
this.fontColor = Colors.white,
this.selectedItem,
this.showTitleWhenSelected = false,
this.selectCallback});
```
### 参数说明

| **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** |
| --- | --- | --- | --- | --- |
| width | double || | 0 |
| height | double || | 0 |
| width | double || | 0 |
| height | double || | 0 |
| padding | EdgeInsetsGeometry | 内边距 || EdgeInsets.zero |
| ringWidth | double | 圆环宽度 || 50 |
| data | `List<BrnDoughnutDataItem>` | 饼图数据 || |
| fontSize | double | 选中时展示文字大小 || 12 |
| fontColor | Color | 选中时展示文字颜色 || |
| selectedItem | BrnDoughnutDataItem | 选中的项目 || |
| selectCallback | BrnDoughnutSelectCallback | 选中项目时候的回掉 || |
| showTitleWhenSelected | bool | 是否仅在选中时展示 title || |
| fontColor | Color | 选中时展示文字颜色 || Colors.white |
| selectedItem | BrnDoughnutDataItem? | 选中的项目 || |
| selectCallback | BrnDoughnutSelectCallback? | 选中项目时候的回掉 || |
| showTitleWhenSelected | bool | 是否仅在选中时展示 title || false |

### 其他数据


```dart
DoughnutChartLegend({this.legendStyle = BrnDoughnutChartLegendStyle.wrap, this.data});
DoughnutChartLegend(
{this.legendStyle = BrnDoughnutChartLegendStyle.wrap,
required this.data});
```
## 四、代码演示

Expand All @@ -79,7 +81,7 @@ Column(
data: dataList,
selectedItem: selectedItem,
showTitleWhenSelected: true,
selectCallback: (BrnDoughnutDataItem selectedItem) {
selectCallback: (BrnDoughnutDataItem? selectedItem) {
setState(() {
this.selectedItem = selectedItem;
});
Expand Down
Loading

0 comments on commit f18f1e3

Please sign in to comment.