From f18f1e344012d3f6fe9aeb9c66daed60acca2707 Mon Sep 17 00:00:00 2001 From: Sandy <15143015732@163.com> Date: Wed, 9 Mar 2022 11:20:30 +0800 Subject: [PATCH] migrate docs to null-safety (#112) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 * :art: 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: 大脸儿 * 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 * 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 * 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 * 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 * 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 * 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 Co-authored-by: LAIIIHZ <35956195+laiiihz@users.noreply.github.com> Co-authored-by: Alex Li Co-authored-by: kalifun <37646342+kalifun@users.noreply.github.com> Co-authored-by: kkkman22 <2594387207@qq.com> Co-authored-by: 大脸儿 Co-authored-by: leftcoding <137387869@qq.com> Co-authored-by: violinday Co-authored-by: jojinshallar Co-authored-by: HappyImp Co-authored-by: Kenneth Co-authored-by: donywan Co-authored-by: foreturn Co-authored-by: Junl <17602153700@163.com> Co-authored-by: yuanjunliang Co-authored-by: Nayuta403 <40540394+Nayuta403@users.noreply.github.com> --- CHANGELOG.md | 1 + .../BrnBottomButtonPanel.md | 26 +-- .../BrnMultipleBottomButton.md | 31 ++-- .../BrnButtonPanel/BrnButtonPanel.md | 20 +-- .../BrnTextButtonPanel/BrnTextButtonPanel.md | 12 +- .../charts/BrnBrokenLine/BrnBrokenLine.md | 92 +++++----- .../BrnDoughnutChart/BrnDoughnutChart.md | 38 +++-- .../charts/BrnFunnelChart/BrnFunnelChart.md | 52 +++--- .../BrnProgressBarChart.md | 59 ++++--- .../BrnProgressChart/BrnProgressChart.md | 28 ++-- .../charts/BrnRadarChart/BrnRadarChart.md | 158 +++++++++--------- docs/components/dialog/BrnDialog/BrnDialog.md | 128 +++++++------- .../BrnEnhanceOperationDialog.md | 48 +++--- .../BrnLoadingDialog/BrnLoadingDialog.md | 3 +- .../BrnMiddleInputDialog.md | 55 +++--- .../BrnMultiSelectDialog.md | 104 ++++++------ .../BrnScrollableTextDialog.md | 69 ++++---- .../dialog/BrnShareDialog/BrnShareDialog.md | 60 +++---- .../BrnSingleSelectDialog.md | 52 +++--- .../iconButton/BrnIconButton/BrnIconButton.md | 38 ++--- .../BrnVerticalIconButton.md | 11 +- .../input/BrnInputText/BrnInputText.md | 116 ++++++------- .../loading/BrnPageLoading/BrnPageLoading.md | 3 +- .../BrnBigGhostButton/BrnBigGhostButton.md | 17 +- .../BrnBigMainButton/BrnBigMainButton.md | 17 +- .../BrnBigOutlineButton.md | 19 ++- .../BrnSmallMainButton/BrnSmallMainButton.md | 50 +++--- .../BrnSmallOutlineButton.md | 29 ++-- .../picker/BrnBottomPicker/BrnBottomPicker.md | 30 ++-- .../BrnBottomWritePicker.md | 40 ++--- .../picker/BrnDatePicker/BrnDatePicker.md | 42 ++--- .../BrnDateRangePicker/BrnDateRangePicker.md | 53 +++--- .../BrnMultiColumnPicker.md | 27 +-- .../BrnMultiDataPicker/BrnMultiDataPicker.md | 72 ++++---- .../BrnMultiSelectListPicker.md | 34 ++-- .../BrnMultiSelectTagsPicker.md | 54 +++--- .../BrnSelectTagsWithInputPicker.md | 46 ++--- .../tips/BrnPopupWindow/BrnPopupWindow.md | 55 +++--- docs/components/toast/BrnToast/BrnToast.md | 84 ++++++---- .../button/brn_text_button_panel_example.dart | 5 +- lib/src/components/dialog/brn_dialog.dart | 85 +--------- .../dialog/brn_middle_input_diaolg.dart | 5 - .../bean/brn_multi_column_picker_entity.dart | 3 +- 43 files changed, 972 insertions(+), 999 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70537f23..7aed7f0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Add build test thank to **AlexV525**. #### components +- **Breaking change**: remove BrnHorizontalStepsManager and put function forwardStep() backStep() into BrnStepsController thanks to leftcoding. - BrnCalendarView: add BrnCalendarView.single() and BrnCalendarView.range() constructor and had its argument startEndDateChange removed. - BrnSelectionEntityListBean: fromMap is renamed to fromJson. - BrnRadioButton: optimize click area [#31](https://github.com/LianjiaTech/bruno/pull/31) , thanks to **a1017480401** . diff --git a/docs/components/bottomButtonPanel/BrnBottomButtonPanel/BrnBottomButtonPanel.md b/docs/components/bottomButtonPanel/BrnBottomButtonPanel/BrnBottomButtonPanel.md index c2eb8ac1..232526b3 100644 --- a/docs/components/bottomButtonPanel/BrnBottomButtonPanel/BrnBottomButtonPanel.md +++ b/docs/components/bottomButtonPanel/BrnBottomButtonPanel/BrnBottomButtonPanel.md @@ -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? | icon按钮的集合 | 否 | 无 | | enableMainButton | bool | 主按钮是否可用 | 否 | true | | enableSecondaryButton | bool | 次按钮是否可用 | 否 | true | diff --git a/docs/components/bottomButtonPanel/BrnMultipleBottomButton/BrnMultipleBottomButton.md b/docs/components/bottomButtonPanel/BrnMultipleBottomButton/BrnMultipleBottomButton.md index 8bc3441e..da3ad294 100644 --- a/docs/components/bottomButtonPanel/BrnMultipleBottomButton/BrnMultipleBottomButton.md +++ b/docs/components/bottomButtonPanel/BrnMultipleBottomButton/BrnMultipleBottomButton.md @@ -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); ``` @@ -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? | 暴露给外界设置按钮状态的控制器 | 否 | | diff --git a/docs/components/buttonPanel/BrnButtonPanel/BrnButtonPanel.md b/docs/components/buttonPanel/BrnButtonPanel/BrnButtonPanel.md index b3e914c5..0d39e998 100644 --- a/docs/components/buttonPanel/BrnButtonPanel/BrnButtonPanel.md +++ b/docs/components/buttonPanel/BrnButtonPanel/BrnButtonPanel.md @@ -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); ``` ### 参数说明 diff --git a/docs/components/buttonPanel/BrnTextButtonPanel/BrnTextButtonPanel.md b/docs/components/buttonPanel/BrnTextButtonPanel/BrnTextButtonPanel.md index e4a0a0ef..73e88777 100644 --- a/docs/components/buttonPanel/BrnTextButtonPanel/BrnTextButtonPanel.md +++ b/docs/components/buttonPanel/BrnTextButtonPanel/BrnTextButtonPanel.md @@ -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); ``` ### 参数说明 diff --git a/docs/components/charts/BrnBrokenLine/BrnBrokenLine.md b/docs/components/charts/BrnBrokenLine/BrnBrokenLine.md index 92521285..c34e53e9 100644 --- a/docs/components/charts/BrnBrokenLine/BrnBrokenLine.md +++ b/docs/components/charts/BrnBrokenLine/BrnBrokenLine.md @@ -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, @@ -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, @@ -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` | 要绘制的折线集合 | 是 | | | -| 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` | X 轴刻度数据 | 否 | | | -| yDialValues | `List` | 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` | 要绘制的折线集合 | 是 | | | +| 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` | X 轴刻度数据 | 否 | | | +| yDialValues | `List`? | 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 | | ### 其他数据结构 @@ -101,15 +107,14 @@ class BrnPointData { Offset offset; /// 点要展示的内容 - String pointText; + String? pointText; /// 点展示内容样式 - TextStyle pointTextStyle; + TextStyle? pointTextStyle; /// 折线节点的点击击事件是否可用 bool isClickable; - /// 每个点的点击行为配置数据 BrnLineTouchData lineTouchData; } ``` @@ -119,7 +124,7 @@ class BrnPointData { ``` class BrnLineTouchData { /// 用于临时存储要展示 tip 内容在坐标的位置 - double x, y; + double? x, y; /// 要展示 tip 的相对偏移量 Offset tipOffset; @@ -127,11 +132,8 @@ class BrnLineTouchData { /// 要展示的 tip 的宽高 Size tipWindowSize; - /// 折线节点点击事件是否可用 - bool enabled; - /// 点击回调,由于返回 展示内容(String 或 Widget) - Function() onTouch; + Function()? onTouch; } ``` @@ -147,22 +149,22 @@ class BrnPointsLine { double lineWidth; /// Line渐变色,从曲线到x轴从上到下的闭合颜色集 - List shaderColors; + List? shaderColors; /// 曲线或折线的颜色 Color lineColor; /// 点外圈的颜色 - Color pointColor; + Color? pointColor; /// 点的外半径参数 double pointRadius; /// 点内圈的颜色 - Color pointInnerColor; + Color? pointInnerColor; /// 点内圈的半径 - double pointInnerRadius; + double? pointInnerRadius; /// 是否显示x轴的文字,用来处理多个线条绘制的时候,同一x轴坐标不需要绘制多次,则只需要将多条线中一个标记绘制即可 bool isShowXDial; @@ -183,10 +185,10 @@ class BrnPointsLine { ```dart class BrnDialItem { /// 刻度标志内容 - String dialText; + String? dialText; /// 刻度标志样式 - TextStyle dialTextStyle; + TextStyle? dialTextStyle; /// x,y 轴刻度值。用于刻度在坐标的真实定位 double value; diff --git a/docs/components/charts/BrnDoughnutChart/BrnDoughnutChart.md b/docs/components/charts/BrnDoughnutChart/BrnDoughnutChart.md index d9d6206c..69f0ae97 100644 --- a/docs/components/charts/BrnDoughnutChart/BrnDoughnutChart.md +++ b/docs/components/charts/BrnDoughnutChart/BrnDoughnutChart.md @@ -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` | 饼图数据 | 是 | | | 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}); ``` ## 四、代码演示 @@ -79,7 +81,7 @@ Column( data: dataList, selectedItem: selectedItem, showTitleWhenSelected: true, - selectCallback: (BrnDoughnutDataItem selectedItem) { + selectCallback: (BrnDoughnutDataItem? selectedItem) { setState(() { this.selectedItem = selectedItem; }); diff --git a/docs/components/charts/BrnFunnelChart/BrnFunnelChart.md b/docs/components/charts/BrnFunnelChart/BrnFunnelChart.md index e7002b9e..0ef3f561 100644 --- a/docs/components/charts/BrnFunnelChart/BrnFunnelChart.md +++ b/docs/components/charts/BrnFunnelChart/BrnFunnelChart.md @@ -47,36 +47,36 @@ group: ```dart BrnFunnelChart({ - Key key, - @required this.layerCount, - @required this.markerCount, - @required this.layerPainter, - @required MarkerBuilder builder, - this.shape = FunnelShape.LeftAndRight, - this.maxLayerWidth = 200, - this.minLayerWidth = 0, - this.layerHeight = 40, - this.layerMargin = 0, - this.childOffset = Offset.zero, - this.alignment = MarkerAlignment.right, -}) + Key? key, + required this.layerCount, + required this.markerCount, + required this.layerPainter, + required MarkerBuilder builder, + this.shape = FunnelShape.leftAndRight, + this.maxLayerWidth = 200, + this.minLayerWidth = 0, + this.layerHeight = 40, + this.layerMargin = 0, + this.childOffset = Offset.zero, + this.alignment = MarkerAlignment.right, + }) ``` ### 参数说明 -| 参数名 | 参数类型 | 描述 | 是否必填 | 默认值 | 备注 | -| ------------- | --------------------- | --------------------------- | -------- | ------------------------ | -------------------------------------------------------------------------------------------- | -| layerCount | int | 漏斗图的层级数 | 是 | | | -| markerCount | int | 漏斗图的标签个数 | 是 | | 标签个数和层技数必须相等或者是少一个 | -| layerPainer | BrnFunnelLayerPainter | 用于控制绘制每一次层的文案 | 是 | | 见详细 BrnFunnelLayerPainter 介绍 | -| builder | Function | 用于提供每一层的标签 Widget | 是 | | | +| 参数名 | 参数类型 | 描述 | 是否必填 | 默认值 | 备注 | +| ------------- | --------------------- | --------------------------- | -------- | ------------------------ | ------------------------------------------------------------ | +| layerCount | int | 漏斗图的层级数 | 是 | | | +| markerCount | int | 漏斗图的标签个数 | 是 | | 标签个数和层技数必须相等或者是少一个 | +| layerPainer | BrnFunnelLayerPainter | 用于控制绘制每一次层的文案 | 是 | | 见详细 BrnFunnelLayerPainter 介绍 | +| builder | Function | 用于提供每一层的标签 Widget | 是 | | | | shape | FunnelShape | 用于控制漏斗的形状 | 否 | FunnelShape.LeftAndRight | FunnelShape.LeftAndRight 表示倒三角的漏斗图形状 FunnelShape.LeftorRight 表示梯形形状的漏斗图 | -| maxLayerWidth | double | 漏斗每层的最大宽度 | 否 | 200 | | -| minLayerWidth | double | 漏斗每层的最小宽度 | 否 | 0 | | -| layerHeight | double | 漏斗每层的高度 | 否 | 40 | | -| layerMargin | double | 漏斗每层的间距 | 否 | 0 | | -| childOffset | Offset | 标签的偏移量 | 否 | Offset.Zero | 标签在初始摆放位置上的相对偏移量 | -| alignment | MarkerAlignment | 标签的对齐方式 | 否 | | 总共有三种情况偏左,居中和偏右。当漏斗 shape 为 FunnelShape.LeftorRight 时不能设置成居中 | +| maxLayerWidth | double | 漏斗每层的最大宽度 | 否 | 200 | | +| minLayerWidth | double | 漏斗每层的最小宽度 | 否 | 0 | | +| layerHeight | double | 漏斗每层的高度 | 否 | 40 | | +| layerMargin | double | 漏斗每层的间距 | 否 | 0 | | +| childOffset | Offset | 标签的偏移量 | 否 | Offset.Zero | 标签在初始摆放位置上的相对偏移量 | +| alignment | MarkerAlignment | 标签的对齐方式 | 否 | MarkerAlignment.right | 总共有三种情况偏左,居中和偏右。当漏斗 shape 为 FunnelShape.leftOrRight 时不能设置成居中 | #### BrnFunnelLayerPainter @@ -107,7 +107,7 @@ abstract class BrnFunnelLayerPainter { ```dart BrnFunnelChart( - shape: FunnelShape.LeftOrRight, + shape: FunnelShape.leftOrRight, alignment: MarkerAlignment.right, maxLayerWidth: maxLayerWidth, minLayerWidth: minLayerWidth, diff --git a/docs/components/charts/BrnProgressBarChart/BrnProgressBarChart.md b/docs/components/charts/BrnProgressBarChart/BrnProgressBarChart.md index d989efcb..ac64e1c4 100644 --- a/docs/components/charts/BrnProgressBarChart/BrnProgressBarChart.md +++ b/docs/components/charts/BrnProgressBarChart/BrnProgressBarChart.md @@ -32,40 +32,49 @@ group: ```dart BrnProgressBarChart( - {Key key, - this.minWidth = 0, - this.padding = const EdgeInsets.all(20), - this.barChartStyle = BarChartStyle.vertical, - this.xAxis, - this.yAxis, - this.barBundleList, - this.barGroupSpace = 30, - this.singleBarWidth = 30, - this.barMaxValue, - this.selectedHintTextColor = Colors.white, - this.selectedHintTextBackgroundColor = Colors.black, - this.onBarItemClickInterceptor, - this.barChartSelectCallback, - this.height = 300}) + {Key? key, + this.minWidth = 0, + this.padding = const EdgeInsets.all(20), + this.barChartStyle = BarChartStyle.vertical, + required this.xAxis, + required this.yAxis, + required this.barBundleList, + this.barGroupSpace = 30, + this.singleBarWidth = 30, + this.barMaxValue = 0, + this.selectedHintTextColor = Colors.white, + this.selectedHintTextBackgroundColor = Colors.black, + this.onBarItemClickInterceptor, + this.barChartSelectCallback, + this.height = 300}) + : super(key: key) { + if (BarChartStyle.horizontal == barChartStyle) { + assert(barBundleList[0].barList.length == yAxis.axisItemList.length, + '水平柱状图个数与Y轴坐标数目要相等'); + } else if (BarChartStyle.vertical == barChartStyle) { + assert(barBundleList[0].barList.length == xAxis.axisItemList.length, + '竖直柱状图个数与X轴坐标数目要相等'); + } + } ``` ### 参数说明 | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | | --- | --- | --- | --- | --- | -| minWidth | double | 最小宽度 | | 0 | +| minWidth | double | 最小宽度 | 否 | 0 | | height | double | 图标高度 | 否 | 300 | -| padding | EdgeInsetsGeometry | 内边距 | | EdgeInsets.all(20) | -| barChartStyle | BarChartStyle | 水平/竖直方向条形图 | | BarChartStyle.vertical | +| padding | EdgeInsetsGeometry | 内边距 | 否 | EdgeInsets.all(20) | +| barChartStyle | BarChartStyle | 水平/竖直方向条形图 | 否 | BarChartStyle.vertical | | xAxis | ChartAxis | x轴数据 | 是 | | | yAxis | ChartAxis | y轴数据 | 是 | | | barBundleList | `List` | 柱形数据 | 是 | | -| barGroupSpace | double | 柱状图间距 | | 30 | -| singleBarWidth | double | 条形宽度 | | 30 | -| barMaxValue | double | 柱状图最大值 | | | -| selectedHintTextColor | Color | 选中柱状图提示文案文本颜色 | | Colors.white | -| selectedHintTextBackgroundColor | Color | 选中柱状图提示文案文本背景颜色 | | Colors.black | -| barChartSelectCallback | void Function(BarItem barItem) | 选中柱状图时候的回调 | | | -| onBarItemClickInterceptor | bool OnBarItemClickInterceptor(int barBundleIndex, BarBundle barBundle, int barGroupIndex, BarItem barItem) | 柱状图是否可点击回调 | | | +| barGroupSpace | double | 柱状图间距 | 否 | 30 | +| singleBarWidth | double | 条形宽度 | 否 | 30 | +| barMaxValue | double | 柱状图最大值 | 否 | 0 | +| selectedHintTextColor | Color | 选中柱状图提示文案文本颜色 | 否 | Colors.white | +| selectedHintTextBackgroundColor | Color | 选中柱状图提示文案文本背景颜色 | 否 | Colors.black | +| barChartSelectCallback | void Function(BarItem barItem) | 选中柱状图时候的回调 | 否 | | +| onBarItemClickInterceptor | bool OnBarItemClickInterceptor(int barBundleIndex, BarBundle barBundle, int barGroupIndex, BarItem barItem) | 柱状图是否可点击回调 | 否 | | ## 四、代码演示 diff --git a/docs/components/charts/BrnProgressChart/BrnProgressChart.md b/docs/components/charts/BrnProgressChart/BrnProgressChart.md index f87aea85..197001b8 100644 --- a/docs/components/charts/BrnProgressChart/BrnProgressChart.md +++ b/docs/components/charts/BrnProgressChart/BrnProgressChart.md @@ -31,19 +31,19 @@ value属性值必须在0 到 1 之间。 ```dart -BrnProgressChart( - {Key key, - this.width = 0, - this.height = 0, - this.value = 0.2, - this.indicatorLeftPadding = 10, - this.textStyle = const TextStyle(color: Colors.white), - this.brnProgressIndicatorBuilder, - this.colors = const [Colors.blueAccent, Colors.blue], - this.backgroundColor = Colors.lightBlueAccent, - this.showAnimation = false}) - : assert(0 <= value && value <= 1, 'value 必须在 0 到 1 之间'), - super(key: key); +const BrnProgressChart( + {Key? key, + this.width = 0, + this.height = 0, + this.value = 0.2, + this.indicatorLeftPadding = 10, + this.textStyle = const TextStyle(color: Colors.white), + this.brnProgressIndicatorBuilder, + this.colors = const [Colors.blueAccent, Colors.blue], + this.backgroundColor = Colors.lightBlueAccent, + this.showAnimation = false}) + : assert(0 <= value && value <= 1, 'value 必须在 0 到 1 之间'), + super(key: key); ``` ### 参数说明 @@ -51,7 +51,7 @@ BrnProgressChart( | --- | --- | --- | --- | --- | | width | double | 宽度 | 是 | 0 | | height | double | 高度 | 是 | 0 | -| value | double | 进度图进度值,必须在 0 到 1 之间 | 是 | 0 | +| value | double | 进度图进度值,必须在 0 到 1 之间 | 是 | 0.2 | | indicatorLeftPadding | double | 进度条上自定义Widget的左侧padding | 否 | 10 | | textStyle | TextStyle | 展示默认进度indicator的时候的文本样式 | 否 | TextStyle(color: Colors.white) | | brnProgressIndicatorBuilder | BrnProgressIndicatorBuilder | 自定义进度条上面的Widget,默认显示为文本 | 否 | null | diff --git a/docs/components/charts/BrnRadarChart/BrnRadarChart.md b/docs/components/charts/BrnRadarChart/BrnRadarChart.md index 5530194e..4ce76c92 100644 --- a/docs/components/charts/BrnRadarChart/BrnRadarChart.md +++ b/docs/components/charts/BrnRadarChart/BrnRadarChart.md @@ -38,21 +38,31 @@ group: ```dart BrnRadarChart({ - Key key, - @required this.provider, - @required MarkerBuilder builder, - this.radius = 50, - this.levelCount = 3, - this.maxValue = 10, - this.minValue = 0, - this.markerMargin = 4, - this.sidesCount = 5, - this.offset, - this.axisLineColor = const Color(0xFFCCCCCC), - this.crossedAxisLine = false, - this.animateProgress = 1.0, - this.rotateAngle = 0, -}) + Key? key, + required this.provider, + required MarkerBuilder builder, + this.radius = 50, + this.levelCount = 3, + this.maxValue = 10, + this.minValue = 0, + this.markerMargin = 4, + this.sidesCount = 5, + this.offset, + this.axisLineColor = const Color(0xFFCCCCCC), + this.crossedAxisLine = false, + this.animateProgress = 1.0, + this.rotateAngle = 0, + }) : assert(minValue < maxValue), + assert(sidesCount >= 3), + super( + key: key, + children: () { + List children = []; + for (int i = 0; i < sidesCount; i++) { + children.add(builder(i)); + } + return children; + }()); ``` #### 默认风格 @@ -61,71 +71,69 @@ BrnRadarChart({ ```dart BrnRadarChart.defaultStyle({ - Key key, - this.radius = 50, - this.levelCount = 3, - this.maxValue = 10, - this.minValue = 0, - this.markerMargin = 4, - this.sidesCount = 5, - this.rotateAngle = 0, - this.crossedAxisLine = false, - this.offset, - @required List tagNames, - @required List> data, - }) : assert(sidesCount != null), - assert(tagNames != null), - assert(data != null), - assert(tagNames.length == sidesCount), - assert(minValue < maxValue), - assert(data.length <= defaultRadarChartStyles.length), - this.animateProgress = 1.0, - this.axisLineColor = const Color(0xFFCCCCCC), - this.provider = DefaultRadarProvider(data), - super( - key: key, - children: () { - List children = List(); - for (int i = 0; i < sidesCount; i++) { - children.add(Container( - constraints: BoxConstraints( - maxWidth: 60, - maxHeight: 32, - ), - child: Text( - tagNames[i], - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xFF222222), - fontSize: 12, - fontWeight: FontWeight.w600), - ), - )); - } - return children; -}()); + Key? key, + this.radius = 50, + this.levelCount = 3, + this.maxValue = 10, + this.minValue = 0, + this.markerMargin = 4, + this.sidesCount = 5, + this.rotateAngle = 0, + this.crossedAxisLine = false, + this.offset, + required List tagNames, + required List> data, + }) : assert(sidesCount >= 3), + assert(tagNames.length == sidesCount), + assert(minValue < maxValue), + assert(data.length <= defaultRadarChartStyles.length), + this.animateProgress = 1.0, + this.axisLineColor = const Color(0xFFCCCCCC), + this.provider = DefaultRadarProvider(data), + super( + key: key, + children: () { + List children = []; + for (int i = 0; i < sidesCount; i++) { + children.add(Container( + constraints: BoxConstraints( + maxWidth: 60, + maxHeight: 32, + ), + child: Text( + tagNames[i], + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xFF222222), + fontSize: 12, + fontWeight: FontWeight.w600), + ), + )); + } + return children; + }()); ``` ### 参数说明 -| 参数名 | 参数类型 | 作用 | 是否必填 | 默认值 | 备注 | -| --------------- | ------------------------- | ---------------------------------------------- | ---------------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------- | -| radius | double | 雷达图半径(多边形外接圆的半径) | 否 | 50 | | -| levelCount | int | 数据可划分的区间个数 | 否 | 3 | 每个区间取值范围等分 | -| maxValue | double | 数据的最大值 | 否 | 10 | 提供的数据要不大于最大值,否则当最大值处理 | -| minValue | double | 数据的最小值 | 否 | 0 | 提供的数据要不小于最小值,否则当最小值处理 | -| markerMargin | double | 标签和雷达图顶点的间距 | 否 | 4 | | -| sidesCount | int | 雷达数据的维度(多边形的边数) | 否 | 5 | 边数应该和单个雷达数据的个数一致,否则可能出错 | +| 参数名 | 参数类型 | 作用 | 是否必填 | 默认值 | 备注 | +| --------------- | ------------------------- | ---------------------------------------------- | ---------------------------------------------------- | ----------------- | ------------------------------------------------------------ | +| radius | double | 雷达图半径(多边形外接圆的半径) | 否 | 50 | | +| levelCount | int | 数据可划分的区间个数 | 否 | 3 | 每个区间取值范围等分 | +| maxValue | double | 数据的最大值 | 否 | 10 | 提供的数据要不大于最大值,否则当最大值处理 | +| minValue | double | 数据的最小值 | 否 | 0 | 提供的数据要不小于最小值,否则当最小值处理 | +| markerMargin | double | 标签和雷达图顶点的间距 | 否 | 4 | | +| sidesCount | int | 雷达数据的维度(多边形的边数) | 否 | 5 | 边数应该和单个雷达数据的个数一致,否则可能出错 | | data | `List>` | 提供所需绘制的雷达图个数以及各雷达图顶点的数值 | 是 | | 是个二维数组,第一维决定了需要绘制多少个雷达在图表中,第二维表示每雷达每一个顶点的数值 | -| tagNames | `List` | 各个顶点的标签文案 | 是 | | 文案的个数与顶点个数应保持一致 | -| rotateAngle | double | 整个雷达图旋转角度 | 否 | 0 | | -| crossedAxisLine | bool | 是否展示中间十字交叉线 | | | | -| offset | `List` | 每个标注文案的偏移量 | 否 | [Offset.zero] | 个数应与 sidesCount 保持一致 | -| provider | BrnRadarChartDataProvider | 提供绘制雷达图所需要的数据 | 使用默认构造方法必传。默认样式无此参数配置。 | | | -| builder | MarkerBuilder | 自定义雷达图的标签(标签由使用者提供 widget) | 使用默认构造方法必传。默认样式无此参数配置。 | | | -| axisLineColor | Color | 背景多边形轴颜色 | 默认构造方法有此配置,非必传。默认样式无此参数配置。 | Color(0xFFCCCCCC) | | -| animateProgress | double | 控制带动画效果绘制时的绘制快慢 | 默认构造方法有此配置,非必传。默认样式无此参数配置。 | 1.0 | | +| tagNames | `List` | 各个顶点的标签文案 | 是 | | 文案的个数与顶点个数应保持一致 | +| rotateAngle | double | 整个雷达图旋转角度 | 否 | 0 | | +| crossedAxisLine | bool | 是否展示中间十字交叉线 | | | | +| offset | `List?` | 每个标注文案的偏移量 | 否 | [Offset.zero] | 个数应与 sidesCount 保持一致 | +| provider | BrnRadarChartDataProvider | 提供绘制雷达图所需要的数据 | 使用默认构造方法必传。默认样式无此参数配置。 | | | +| builder | MarkerBuilder | 自定义雷达图的标签(标签由使用者提供 widget) | 使用默认构造方法必传。默认样式无此参数配置。 | | | +| axisLineColor | Color | 背景多边形轴颜色 | 默认构造方法有此配置,非必传。默认样式无此参数配置。 | Color(0xFFCCCCCC) | | +| animateProgress | double | 控制带动画效果绘制时的绘制快慢 | 默认构造方法有此配置,非必传。默认样式无此参数配置。 | 1.0 | | 首先介绍两个构造函数中涉及到的相关的类 diff --git a/docs/components/dialog/BrnDialog/BrnDialog.md b/docs/components/dialog/BrnDialog/BrnDialog.md index 2568564c..4a272260 100644 --- a/docs/components/dialog/BrnDialog/BrnDialog.md +++ b/docs/components/dialog/BrnDialog/BrnDialog.md @@ -35,45 +35,43 @@ group: ```dart BrnDialog({ - this.showIcon = false, - this.iconImage, - this.titleText, - this.messageText, - this.titleWidget, - this.contentWidget, - this.warningText, - this.warningWidget, - this.actionsWidget, - this.brnDialogStyle, - this.divider = cDividerLine, - this.verticalDivider = cVerticalDivider, - this.actionsText, - this.indexedActionCallback, - this.dismiss = true, - this.themeData, - this.titleMaxLines = cTitleMaxLines, -}); + Key? key, + this.showIcon = false, + this.iconImage, + this.titleText, + this.messageText, + this.titleWidget, + this.contentWidget, + this.warningText, + this.warningWidget, + this.actionsWidget, + this.divider = cDividerLine, + this.verticalDivider = cVerticalDivider, + this.actionsText, + this.indexedActionCallback, + this.themeData, + this.titleMaxLines = cTitleMaxLines, + }) : super(key: key); ``` ### 参数配置 | **参数名** | **参数类型** | **作用** | **是否必填** | **默认值** | | --- | --- | --- | --- | --- | | showIcon | bool | 是否显示icon | 否 | false | -| iconImage | Image | 头部显示的icon 默认为alert | 否 | 主题色alert | -| titleText | String | 对话框的标题文案 | 否 | 无 | -| messageText | String | 对话框中间的显示文本 | 否 | 无 | -| warningText | String | 对话框的警示文案文本 | 否 | 无 | -| actionsText | List | 对话框底部的按钮 | 否 | 无 | -| titleWidget | Widget | 自定义widget的标题 | 否 | 无 | -| contentWidget | Widget | 自定义widget的内容 | 否 | 无 | -| warningWidget | Widget | 自定义widget的警示内容 | 否 | 无 | -| actionsWidget | List | 对话框底部的自定义widget按钮 | 否 | 无 | -| indexedActionCallback | DialogIndexedActionClickCallback | 对话框底部的点击回调 | 否 | 无 | -| brnDialogStyle | BrnDialogStyle | 对话框的样式:主色调间距等等 | 否 | 自定义样式 | +| iconImage | Image? | 头部显示的icon 默认为alert | 否 | 主题色alert | +| titleText | String? | 对话框的标题文案 | 否 | 无 | +| messageText | String? | 对话框中间的显示文本 | 否 | 无 | +| warningText | String? | 对话框的警示文案文本 | 否 | 无 | +| actionsText | List? | 对话框底部的按钮 | 否 | 无 | +| titleWidget | Widget? | 自定义widget的标题 | 否 | 无 | +| contentWidget | Widget? | 自定义widget的内容 | 否 | 无 | +| warningWidget | Widget? | 自定义widget的警示内容 | 否 | 无 | +| actionsWidget | List? | 对话框底部的自定义widget按钮 | 否 | 无 | +| indexedActionCallback | DialogIndexedActionClickCallback? | 对话框底部的点击回调 | 否 | 无 | | divider | Divider | 底部按钮的水平和上面内容的水平分割线 | 否 | 高1像素的L1分割线 | | verticalDivider | VerticalDivider | 底部按钮之间的分割线 | 否 | 宽1像素的L1分割线 | | titleMaxLines | int | 标题文本的最大展示行数 | 否 | 2 | -| dismiss | bool | 点击底部按钮是否关闭弹窗 | 否 | true | +| themeData | BrnDialogConfig? | 主题配置 | 否 | 无 | ### 快捷使用类BrnDialogManager @@ -86,19 +84,18 @@ BrnDialog({ | context | BuildContext | 用于显示弹窗的上下文 | 是 | 五 | | label | String | 弹窗的按钮文案 | 是 | 无 | | showIcon | bool | 是否显示icon | 否 | false | -| iconImage | Image | 头部显示的icon 默认为alert | 否 | 主题色alert | -| title | String | 对话框的标题文案 | 否 | 无 | -| titleWidget | Widget | 自定义widget的标题 | 否 | 无 | -| message | String | 对话框中间的显示文本 | 否 | 无 | -| messageWidget | Widget | 自定义widget的内容 | 否 | 无 | -| warning | String | 对话框的警示文案文本 | 否 | 无 | +| iconWidget | Image? | 头部显示的icon 默认为alert | 否 | 主题色alert | +| title | String? | 对话框的标题文案 | 否 | 无 | +| titleWidget | Widget? | 自定义widget的标题 | 否 | 无 | +| message | String? | 对话框中间的显示文本 | 否 | 无 | +| messageWidget | Widget? | 自定义widget的内容 | 否 | 无 | +| warning | String? | 对话框的警示文案文本 | 否 | 无 | | warningWidget | Widget | 自定义widget的警示内容 | 否 | 无 | -| dismiss | bool | 点击对话框按钮之后,对话框是否消失 | 否 | true 消失 | -| labelWidget | Widget | 对话框底部的自定义widget按钮 | 否 | 无 | -| onTap | GestureTapCallback | 对话框按钮的点击回调 | 否 | 无 | -| indexedActionCallback | DialogIndexedActionClickCallback | 对话框底部的点击回调 | 否 | 无 | -| dialogStyle | BrnDialogStyle | 对话框的样式:主色调间距等等 | 否 | B端样式 | +| labelWidget | Widget? | 对话框底部的自定义widget按钮 | 否 | 无 | +| onTap | GestureTapCallback? | 对话框按钮的点击回调 | 否 | 无 | | barrierDismissible | bool | 点击对话框遮罩是否消失对话框 | 否 | true 关闭 | +| titleMaxLines | int | 标题最大行数 | 否 | 3 | +| themeData | BrnDialogConfig? | 主题配置 | 否 | 无 | #### 效果2: showConfirmDialog(双按钮) @@ -110,20 +107,21 @@ BrnDialog({ | cancel | String | 弹窗的左侧文案 | 是 | 无 | | confirm | String | 弹窗的右侧文案 | 是 | 无 | | showIcon | bool | 是否显示icon | 否 | false | -| iconImage | Image | 头部显示的icon 默认为alert | 否 | 主题色alert | -| title | String | 对话框的标题文案 | 否 | 无 | -| titleWidget | Widget | 自定义widget的标题 | 否 | 无 | -| message | String | 对话框中间的显示文本 | 否 | 无 | -| messageWidget | Widget | 自定义widget的内容 | 否 | 无 | -| warning | String | 对话框的警示文案文本 | 否 | 无 | -| warningWidget | Widget | 自定义widget的警示内容 | 否 | 无 | +| iconWidget | Image? | 头部显示的icon 默认为alert | 否 | 主题色alert | +| title | String? | 对话框的标题文案 | 否 | 无 | +| titleWidget | Widget? | 自定义widget的标题 | 否 | 无 | +| message | String? | 对话框中间的显示文本 | 否 | 无 | +| messageWidget | Widget? | 自定义widget的内容 | 否 | 无 | +| warning | String? | 对话框的警示文案文本 | 否 | 无 | +| warningWidget | Widget? | 自定义widget的警示内容 | 否 | 无 | | dismiss | bool | 点击对话框按钮之后,对话框是否消失 | 否 | true 消失 | -| cancelWidget | Widget | 对话框底部左侧的自定义widget按钮 | 否 | 无 | -| conformWidget | Widget | 对话框底部右侧的自定义widget按钮 | 否 | 无 | -| cancelTap | GestureTapCallback | 对话框左侧按钮的点击回调 | 否 | 无 | -| confirmTap | GestureTapCallback | 对话框右侧按钮的点击回调 | 否 | 无 | -| dialogStyle | BrnDialogStyle | 对话框的样式:主色调间距等等 | 否 | B端样式 | +| cancelWidget | Widget? | 对话框底部左侧的自定义widget按钮 | 否 | 无 | +| conformWidget | Widget? | 对话框底部右侧的自定义widget按钮 | 否 | 无 | +| onCancel | GestureTapCallback? | 对话框左侧按钮的点击回调 | 否 | 无 | +| onConfirm | GestureTapCallback? | 对话框右侧按钮的点击回调 | 否 | 无 | | barrierDismissible | bool | 点击对话框遮罩是否消失对话框 | 否 | true 关闭 | +| titleMaxLines | int | 标题最大行数 | 否 | 3 | +| themeData | BrnDialogConfig? | 主题配置 | 否 | 无 | #### 效果3: showMoreButtonDialog(多按钮) @@ -132,20 +130,20 @@ BrnDialog({ | **参数名** | **参数类型** | **作用** | **是否必填** | **默认值** | | --- | --- | --- | --- | --- | | context | BuildContext | 用于显示弹窗的上下文 | 是 | 五 | -| actionsText | List | 对话框底部的按钮 | 否 | 无 | +| actions | List | 对话框底部的按钮 | 否 | 无 | | showIcon | bool | 是否显示icon | 否 | false | -| iconWidget | Image | 头部显示的icon 默认为alert | 否 | 主题色alert | -| title | String | 对话框的标题文案 | 否 | 无 | -| titleWidget | Widget | 自定义widget的标题 | 否 | 无 | -| message | String | 对话框中间的显示文本 | 否 | 无 | -| messageWidget | Widget | 自定义widget的内容 | 否 | 无 | -| warning | String | 对话框的警示文案文本 | 否 | 无 | -| warningWidget | Widget | 自定义widget的警示内容 | 否 | 无 | -| dismiss | bool | 点击对话框按钮之后,对话框是否消失 | 否 | true 消失 | -| actionsWidget | List | 对话框底部的自定义widget按钮 | 否 | 无 | -| indexedActionClickCallback | DialogIndexedActionClickCallback | 对话按钮点击的回调 | 否 | 无 | -| dialogStyle | BrnDialogStyle | 对话框的样式:主色调间距等等 | 否 | B端样式 | +| iconWidget | Image? | 头部显示的icon 默认为alert | 否 | 主题色alert | +| title | String? | 对话框的标题文案 | 否 | 无 | +| titleWidget | Widget? | 自定义widget的标题 | 否 | 无 | +| message | String? | 对话框中间的显示文本 | 否 | 无 | +| messageWidget | Widget? | 自定义widget的内容 | 否 | 无 | +| warning | String? | 对话框的警示文案文本 | 否 | 无 | +| warningWidget | Widget? | 自定义widget的警示内容 | 否 | 无 | +| actionsWidget | List? | 对话框底部的自定义widget按钮 | 否 | 无 | +| indexedActionClickCallback | DialogIndexedActionClickCallback? | 对话按钮点击的回调 | 否 | 无 | +| titleMaxLines | int | 标题最大行数 | 否 | 3 | | barrierDismissible | bool | 点击对话框遮罩是否消失对话框 | 否 | true 关闭 | +| themeData | BrnDialogConfig? | 主题配置 | 否 | 无 | ## 四、效果及代码展示 diff --git a/docs/components/dialog/BrnEnhanceOperationDialog/BrnEnhanceOperationDialog.md b/docs/components/dialog/BrnEnhanceOperationDialog/BrnEnhanceOperationDialog.md index 725c797c..a51e29c7 100644 --- a/docs/components/dialog/BrnEnhanceOperationDialog/BrnEnhanceOperationDialog.md +++ b/docs/components/dialog/BrnEnhanceOperationDialog/BrnEnhanceOperationDialog.md @@ -31,23 +31,23 @@ group: ```dart BrnEnhanceOperationDialog({ - this.iconType, - this.customIconWidget, - this.context, - this.titleText, - this.descText, - this.mainButtonText, - this.secondaryButtonText, - this.mainButtonCallback, - this.secondaryButtonCallback, - this.themeData, -}) { - this.themeData ??= BrnDialogConfig(); - this.themeData = BrnThemeConfigurator.instance - .getConfig(configId: this.themeData.configId) - .dialogConfig - .merge(this.themeData); -} + this.iconType = BrnDialogConstants.iconAlert, + this.customIconWidget, + required this.context, + this.titleText, + this.descText, + this.mainButtonText = '确认', + this.secondaryButtonText, + this.onMainButtonClick, + this.onSecondaryButtonClick, + this.themeData, + }) { + this.themeData ??= BrnDialogConfig(); + this.themeData = BrnThemeConfigurator.instance + .getConfig(configId: this.themeData!.configId) + .dialogConfig + .merge(this.themeData); + } ``` @@ -57,14 +57,14 @@ BrnEnhanceOperationDialog({ | --- | --- | --- | --- | --- | | context | BuildContext | BuidContext | 是 | 空 | | iconType | int | 在预设的提示图标中选择一个座位图标(提示:BrnDialogConstants**.**ICON\_ALERT警示:BrnDialogConstants**.**ICON\_WARNNING成功:BrnDialogConstants**.**ICON\_SUCCESS自定义图标:BrnDialogConstants.ICON\_CUSTOM) | 否 | 0,ICON\_ALERT | -| customIconWidget | Widget | 自定义图标 | 否 | | -| titleText | String | 弹框标题文案(为空则**不显示**标题) | 否 | 无 | -| descText | String | 弹框辅助信息文案(为空则**不显示**辅助信息) | 否 | 无 | +| customIconWidget | Widget? | 自定义图标 | 否 | | +| titleText | String? | 弹框标题文案(为空则**不显示**标题) | 否 | 无 | +| descText | String? | 弹框辅助信息文案(为空则**不显示**辅助信息) | 否 | 无 | | mainButtonText | String | 主要按钮文案 | 否 | 无 | -| secondaryButtonText | String | 次要按钮文案(为空则**不显示**次要按钮) | 否 | 无 | -| mainButtonCallBack | VoidCallback | 点击**主要按钮**后回调方法,使用者**根据参数自行配置响应动作**。 | 否 | 空 | -| secondaryButtonCallBack | VoidCallback | 点击**次要按钮**后回调方法,使用者**根据参数自行配置响应动作**。 | 否 | 空 | -| themeData | BrnDialogConfig | 弹窗主题配置 | 否 | 默认取全局配置 | +| secondaryButtonText | String? | 次要按钮文案(为空则**不显示**次要按钮) | 否 | 无 | +| mainButtonCallBack | VoidCallback? | 点击**主要按钮**后回调方法,使用者**根据参数自行配置响应动作**。 | 否 | 空 | +| secondaryButtonCallBack | VoidCallback? | 点击**次要按钮**后回调方法,使用者**根据参数自行配置响应动作**。 | 否 | 空 | +| themeData | BrnDialogConfig? | 弹窗主题配置 | 否 | 默认取全局配置 | ## 四、代码演示 diff --git a/docs/components/dialog/BrnLoadingDialog/BrnLoadingDialog.md b/docs/components/dialog/BrnLoadingDialog/BrnLoadingDialog.md index 28c9c828..69263fe8 100644 --- a/docs/components/dialog/BrnLoadingDialog/BrnLoadingDialog.md +++ b/docs/components/dialog/BrnLoadingDialog/BrnLoadingDialog.md @@ -24,7 +24,8 @@ group: ### 构造函数 ```dart - BrnLoadingDialog({Key key, this.content = "加载中..."}) : super(key: key); +const BrnLoadingDialog({Key? key, this.content = BrnStrings.loadingContent}) + : super(key: key); ``` ### 参数说明 diff --git a/docs/components/dialog/BrnMiddleInputDialog/BrnMiddleInputDialog.md b/docs/components/dialog/BrnMiddleInputDialog/BrnMiddleInputDialog.md index af1bf338..a8ace15f 100644 --- a/docs/components/dialog/BrnMiddleInputDialog/BrnMiddleInputDialog.md +++ b/docs/components/dialog/BrnMiddleInputDialog/BrnMiddleInputDialog.md @@ -25,42 +25,41 @@ group: ```dart const BrnMiddleInputDialog( - {this.title, - this.message, - this.hintText, - this.maxLength = 20, - this.maxLines, - this.minLines: 1, - this.inputFocusNode, - this.inputEditingController, - this.inputFormatters, - this.cancelText = '取消', - this.confirmText = '确定', - this.dialogStyle, - this.onConfirm, - this.onCancel, - this.dismissOnActionsTap = true, - this.barrierDismissible = true, - this.autoFoucs = false}); + {this.title, + this.message, + this.hintText, + this.maxLength = 20, + this.maxLines, + this.minLines: 1, + this.inputFocusNode, + this.inputEditingController, + this.inputFormatters, + this.textInputAction = TextInputAction.newline, + this.cancelText = '取消', + this.confirmText = '确定', + this.onConfirm, + this.onCancel, + this.dismissOnActionsTap = true, + this.barrierDismissible = true, + this.autoFocus = false}); ``` ### 参数说明 | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | | --- | --- | --- | --- | --- | -| title | String | 标题 | 否 | | -| message | String | 辅助内容 | 否 | | -| hintText | String | 提示语 | 否 | | -| maxLength | int | 最大输入长度 | 否 | | -| maxLines | int | 可输入的最maxLines多行数。超过 [maxLines] 指定的行数后,输入内容会变成可滑动 | 否 | | +| title | String? | 标题 | 否 | | +| message | String? | 辅助内容 | 否 | | +| hintText | String? | 提示语 | 否 | | +| maxLength | int | 最大输入长度 | 否 | 20 | +| maxLines | int? | 可输入的最maxLines多行数。超过 [maxLines] 指定的行数后,输入内容会变成可滑动 | 否 | | | minLines | int | 可输入的最少行数 | 否 | 1 | -| inputFocusNode | FocusNode | 焦点控制 | 否 | | -| inputEditingController | TextEditingController | 输入控制器。如果有初始状态的填充文字,可以通过 [inputEditingController] 设置 | 否 | | +| inputFocusNode | FocusNode? | 焦点控制 | 否 | | +| inputEditingController | TextEditingController? | 输入控制器。如果有初始状态的填充文字,可以通过 [inputEditingController] 设置 | 否 | | | cancelText | String | 取消文案 | 否 | 取消 | | confirmText | String | 确定文案 | 否 | 确定 | -| inputFormatters | TextInputAction | 键盘操作按钮类型,可参见系统的 TextField.textInputAction | 否 | TextInputAction.newline | -| textInputAction | `List` | 用于控制输入的内容范围比如只能输入数字可以填写:`FilteringTextInputFormatter.digitsOnly` | 否 | 无 | -| dialogStyle | BrnDialogStyle | Dialog 风格设置 | 否 | BrnDialogStyle | -| onConfirm | Function(String value) | 确定回调,返回输入的值 | 否 | | +| inputFormatters | List? | 键盘操作按钮类型,可参见系统的 TextField.textInputAction | 否 | TextInputAction.newline | +| textInputAction | `TextInputAction` | 用于控制输入的内容范围比如只能输入数字可以填写:`FilteringTextInputFormatter.digitsOnly` | 否 | 无 | +| onConfirm | void Function(String value)? | 确定回调,返回输入的值 | 否 | | | onCancel | VoidCallback | 取消回调 | 否 | | | dismissOnActionsTap | bool | 点击取消/确认按钮之后,是否自动关闭弹窗 | 否 | true | | barrierDismissible | bool | 点击蒙层背景,弹窗是否可关闭。 | 否 | true | diff --git a/docs/components/dialog/BrnMultiSelectDialog/BrnMultiSelectDialog.md b/docs/components/dialog/BrnMultiSelectDialog/BrnMultiSelectDialog.md index 5902abb1..4d035372 100644 --- a/docs/components/dialog/BrnMultiSelectDialog/BrnMultiSelectDialog.md +++ b/docs/components/dialog/BrnMultiSelectDialog/BrnMultiSelectDialog.md @@ -25,37 +25,37 @@ group: ```dart BrnMultiSelectDialog({ - this.isClose = true, - this.title = "", - this.conditions, - this.messageText, - this.messageWidget, - this.customWidget, - this.isCustomFollowScroll = true, - this.submitText = "提交", - this.submitBgColor, - this.onSubmitClick, - this.onItemClick, - this.isShowOperateWidget = true, -}); + this.isClose = true, + this.title = "", + required this.conditions, + this.messageText, + this.messageWidget, + this.customWidget, + this.isCustomFollowScroll = true, + this.submitText = "提交", + this.submitBgColor, + this.onSubmitClick, + this.onItemClick, + this.isShowOperateWidget = true, + }); ``` ### 参数说明 -| **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | -| -------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------- | ------------ | ---------- | -| isClose | bool | 是否展示右上角【X】按钮 | 是 | | -| conditions | List | 数据源 | 否 | | -| title | String | Dialog title | 否 | | -| messageText | String | 描述文案 | 否 | | -| messageWidget | Widget | 自定义描述 widget | 否 | | -| customWidget | Widget | 底部自定义 widget | 否 | | -| isCustomFollowScroll | bool | 是否支持滚动 | 否 | true | -| onSubmitClick | `bool Function(List data)` | 点击【完成】时回调给外部选中的数据 | 否 | | -| onItemClick | BrnMultiSelectDialogOnItemClickCallback = void Function( BuildContext dialogContext, int index) | Item 被点击的回调 | 否 | | -| submitText | bool | 底部提交按钮的文案 | 否 | 提交 | -| submitBgColor | Color | 底部按钮的主题色 | 否 | 主题色 | -| isShowOperateWidget | bool | 是否展示底部操作区域 | 否 | true | +| **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | +| -------------------- | ---------------------------------------- | ---------------------------------- | ------------ | ---------- | +| isClose | bool | 是否展示右上角【X】按钮 | 否 | true | +| conditions | List | 数据源 | 否 | | +| title | String | Dialog title | 否 | "" | +| messageText | String? | 描述文案 | 否 | | +| messageWidget | Widget? | 自定义描述 widget | 否 | | +| customWidget | Widget? | 底部自定义 widget | 否 | | +| isCustomFollowScroll | bool | 是否支持滚动 | 否 | true | +| onSubmitClick | BrnMultiSelectDialogClickSubmitCallback? | 点击【完成】时回调给外部选中的数据 | 否 | | +| onItemClick | BrnMultiSelectDialogOnItemClickCallback? | Item 被点击的回调 | 否 | | +| submitText | String | 底部提交按钮的文案 | 否 | 提交 | +| submitBgColor | Color? | 底部按钮的主题色 | 否 | 主题色 | +| isShowOperateWidget | bool | 是否展示底部操作区域 | 否 | true | ## 四、代码演示 @@ -64,29 +64,29 @@ BrnMultiSelectDialog({ ```dart -List data = new List(); -data.add(new MultiSelectItem("100", "感兴趣待跟进")); -data.add(new MultiSelectItem("101", "感兴趣但对本商圈没兴趣", isChecked: true)); -data.add(new MultiSelectItem("102", "接通后挂断/不感兴趣", isChecked: true)); -data.add(new MultiSelectItem("103", "未接通")); -data.add(new MultiSelectItem("104", "投诉威胁")); -data.add(new MultiSelectItem("104", "号码错误")); -data.add(new MultiSelectItem("104", "号码错误")); -data.add(new MultiSelectItem("104", "号码错误")); -showDialog( - context: context, - builder: (_) => BrnMultiSelectDialog( - title: "请您评价该条线索", - isClose: true, - conditions: data, - onSubmitClick: (List data) { - var str = ""; - data.forEach((item) { - str = str + item.content + " "; - }); - BrnToast.show(str, context); - return true; - })); +List data = []; + data.add(new MultiSelectItem("100", "感兴趣待跟进")); + data.add(new MultiSelectItem("101", "感兴趣但对本商圈没兴趣", isChecked: true)); + data.add(new MultiSelectItem("102", "接通后挂断/不感兴趣", isChecked: true)); + data.add(new MultiSelectItem("103", "未接通")); + data.add(new MultiSelectItem("104", "投诉威胁")); + data.add(new MultiSelectItem("104", "号码错误")); + data.add(new MultiSelectItem("104", "号码错误")); + data.add(new MultiSelectItem("104", "号码错误")); + showDialog( + context: context, + builder: (_) => BrnMultiSelectDialog( + title: "请您评价该条线索", + isClose: true, + conditions: data, + onSubmitClick: (List data) { + var str = ""; + data.forEach((item) { + str = str + item.content + " "; + }); + BrnToast.show(str, context); + return true; + })); ``` ### 效果 2 @@ -94,7 +94,7 @@ showDialog( ```dart - List data = new List(); + List data = []; data.add(new MultiSelectItem("100", "感兴趣待跟进")); data.add(new MultiSelectItem("101", "感兴趣但对本商圈没兴趣", isChecked: true)); data.add(new MultiSelectItem("102", "接通后挂断/不感兴趣", isChecked: true)); @@ -126,7 +126,7 @@ showDialog( ```dart String hintText = "感兴趣待跟进"; -List data = new List(); +List data = []; data.add(new MultiSelectItem("100", "感兴趣待跟进")); data.add(new MultiSelectItem("101", "感兴趣但对本商圈没兴趣", isChecked: true)); data.add(new MultiSelectItem("102", "接通后挂断/不感兴趣", isChecked: true)); diff --git a/docs/components/dialog/BrnScrollableTextDialog/BrnScrollableTextDialog.md b/docs/components/dialog/BrnScrollableTextDialog/BrnScrollableTextDialog.md index 51215495..fa6c0742 100644 --- a/docs/components/dialog/BrnScrollableTextDialog/BrnScrollableTextDialog.md +++ b/docs/components/dialog/BrnScrollableTextDialog/BrnScrollableTextDialog.md @@ -36,33 +36,33 @@ group: ### 构造函数 ```dart -BrnScrollableTextDialog( - {this.title, - this.isClose = true, - this.contentText, - this.textColor = const Color(0xFF666666), - this.textFontSize = 16, - this.submitText, - this.onSubmitClick, - this.submitBgColor, - this.linksCallback, - this.isShowOperateWidget = true}); +const BrnScrollableTextDialog( + {this.title, + this.isClose = true, + required this.contentText, + this.textColor = const Color(0xFF666666), + this.textFontSize = 16, + this.submitText, + this.onSubmitClick, + this.submitBgColor, + this.linksCallback, + this.isShowOperateWidget = true}); ``` ### 参数说明 -| **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | -| ------------------- | -------------------- | -------------------- | ------------ | ----------------- | -| title | String | 弹框标题 | 否 | 无 | -| isClose | bool | 是否可关闭 | 否 | true | -| contentText | String | 内容 | 否 | 无 | -| textColor | Color | 文字颜色 | 否 | Color(0xFF666666) | -| textFontSize | double | 文字大小 | 否 | 16 | -| submitText | String | 操作按钮文字 | 否 | 无 | -| submitBgColor | Color | 操作按钮背景色 | 否 | 默认主题色 | -| onSubmitClick | VoidCallback | 提交操作 | 否 | 无 | -| linksCallback | BrnHyperLinkCallback | 富文本链接点击回调 | 否 | 无 | -| isShowOperateWidget | bool | 是否展示底部操作区域 | 否 | true | +| **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | +| ------------------- | --------------------- | -------------------- | ------------ | ----------------- | +| title | String? | 弹框标题 | 否 | "" | +| isClose | bool | 是否可关闭 | 否 | true | +| contentText | String | 内容 | 否 | 无 | +| textColor | Color | 文字颜色 | 否 | Color(0xFF666666) | +| textFontSize | double | 文字大小 | 否 | 16 | +| submitText | String? | 操作按钮文字 | 否 | 无 | +| submitBgColor | Color? | 操作按钮背景色 | 否 | 默认主题色 | +| onSubmitClick | VoidCallback? | 提交操作 | 否 | 无 | +| linksCallback | BrnHyperLinkCallback? | 富文本链接点击回调 | 否 | 无 | +| isShowOperateWidget | bool | 是否展示底部操作区域 | 否 | true | ### 其他数据 @@ -70,12 +70,19 @@ BrnScrollableTextDialog( ```dart BrnContentExportWidget(this.contentWidget, - {this.title, - this.isClose, - this.submitText, - this.onSubmitClick, - this.submitBgColor, - this.isShowOperateWidget}); + {this.title, + required this.isClose, + this.submitText, + this.onSubmit, + this.submitBgColor, + required this.isShowOperateWidget, + this.themeData}) { + this.themeData ??= BrnDialogConfig(); + this.themeData = BrnThemeConfigurator.instance + .getConfig(configId: themeData!.configId) + .dialogConfig + .merge(themeData); + } ``` ## 四、代码演示 @@ -125,8 +132,8 @@ showDialog( "文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文" "呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表纯本文呢表", submitText: "提交", - linksCallback: (String text, String url) { - BrnToast.show(text, context); + linksCallback: (String? text, String? url) { + BrnToast.show(text!, context); }, onSubmitClick: () { BrnToast.show("点击了纯文本弹框", context); diff --git a/docs/components/dialog/BrnShareDialog/BrnShareDialog.md b/docs/components/dialog/BrnShareDialog/BrnShareDialog.md index 9fabf885..59109a4d 100644 --- a/docs/components/dialog/BrnShareDialog/BrnShareDialog.md +++ b/docs/components/dialog/BrnShareDialog/BrnShareDialog.md @@ -37,11 +37,11 @@ group: ```dart BrnShareDialog({ - @required this.context, - this.titleText, + required this.context, + required this.titleText, this.descText, this.separatorText, - this.shareChannels, + required this.shareChannels, this.clickCallBack, this.getCustomChannelTitle, this.getCustomChannelWidget, @@ -53,7 +53,7 @@ BrnShareDialog({ }) { this.themeData ??= BrnDialogConfig(); this.themeData = BrnThemeConfigurator.instance - .getConfig(configId: themeData.configId) + .getConfig(configId: themeData!.configId) .dialogConfig .merge(themeData); } @@ -65,32 +65,32 @@ BrnShareDialog({ | **参数名** | **参数类型** | **作用** | **是否必填** | **默认值** | | --- | --- | --- | --- | --- | -| titleText | String | 弹框标题文案 | 否 | 无 | -| descText | String | 弹框辅助信息文案(为空则**不显示**辅助信息) | 否 | 无 | -| separatorText | String | 文案与分享渠道图标间的分割线内嵌文案 | 否 | 你可以通过以下方式分享给客户 | +| titleText | String | 弹框标题文案 | 是 | 无 | +| descText | String? | 弹框辅助信息文案(为空则**不显示**辅助信息) | 否 | 无 | +| separatorText | String? | 文案与分享渠道图标间的分割线内嵌文案 | 否 | 你可以通过以下方式分享给客户 | | shareChannels | `List` | 用于表示所展示的分享渠道图标的索引(列表内容可直接填写渠道对应的**int**值,或使用**BrnShareItemConstants**的静态变量,例如**BrnShareItemConstants.SHARE\_WEIXIN**)。自定义为100或**BrnShareItemConstants.SHARE\_CUSTOM**。 | 是 | 空 | -| clickCallBack | BrnShareDialogItemClickCallBack(int shareChannel, int customIndex) | 点击分享渠道图标后回调方法(方法传参为被点击的分享渠道图标在**BrnShareItemConstants**中的索引值shareChannel, 及改列表在使用者自定义的*shareChannels*中的索引值customIndex),使用者**根据参数自行配置响应动作**。 | 是 | 空 | -| getCustomChannelTitle | BrnShareDialogGetCustomShareItemTitle(int index) | 获取自定义分享渠道对应的显示**文案**(方法传参为该自定义分享渠道在*shareChannels*中的索引值index)。回调返回值为**String**,如果返回值为空,则**不显示**该自定义分享渠道。 | 否 | 空 | -| getCustomChannelWidget | BrnShareDialogGetCustomShareItemIcon(int index) | 获取自定义分享渠道对应的显示**图标**(方法传参为该自定义分享渠道在*shareChannels*中的索引值index)。回调返回值为**Widget**,如果返回值为空,则**不显示**该自定义分享渠道。 | 否 | 空 | -| context | BuildContext | BuidContext | 是 | 空 | +| clickCallBack | BrnShareDialogItemClickCallBack(int shareChannel, int customIndex) | 点击分享渠道图标后回调方法(方法传参为被点击的分享渠道图标在**BrnShareItemConstants**中的索引值shareChannel, 及改列表在使用者自定义的*shareChannels*中的索引值customIndex),使用者**根据参数自行配置响应动作**。 | 否 | 空 | +| getCustomChannelTitle | BrnShareDialogGetCustomShareItemTitle? | 获取自定义分享渠道对应的显示**文案**(方法传参为该自定义分享渠道在*shareChannels*中的索引值index)。回调返回值为**String**,如果返回值为空,则**不显示**该自定义分享渠道。 | 否 | 空 | +| getCustomChannelWidget | BrnShareDialogGetCustomShareItemIcon? | 获取自定义分享渠道对应的显示**图标**(方法传参为该自定义分享渠道在*shareChannels*中的索引值index)。回调返回值为**Widget**,如果返回值为空,则**不显示**该自定义分享渠道。 | 否 | 空 | +| context | BuildContext | BuildContext | 是 | 空 | | titleColor | Color | 标题颜色 | 否 | **Color(0xff222222)** 黑色 | | descColor | Color | 分享渠道文案颜色 | 否 | **Color(0xff666666)**灰色 | -| separatorLineColor | Color | 分割线颜色 | 否 | **Color(0xffEEEEEE)**浅灰 | +| separatorLineColor | Color | 分割线颜色 | 否 | **Color(0xfff0f0f0)**浅灰 | | shareTextColor | Color | 分享渠道文案颜色 | 否 | **Color(0xff999999)**灰色 | | themeData | BrnDialogConfig | 弹窗配置,配置详情见BrnDialogConfig | 否 | | ### 其他数据 -| 常量名 | 渠道名 | -| ----------------------------------- | ------------------------------------------------------------ | -| BrnShareItemConstants.SHARE\_WEIXIN | 微信 | -| BrnShareItemConstants.SHARE\_FRIEND | 朋友圈 | -| BrnShareItemConstants.SHARE\_QQ | qq | -| BrnShareItemConstants.SHARE\_QZONE | qq空间 | -| BrnShareItemConstants.SHARE\_WEIBO | 微博 | -| BrnShareItemConstants.SHARE\_LINK | 链接 | -| BrnShareItemConstants.SHARE\_SMS | 短信 | -| BrnShareItemConstants.SHARE\_CUSTOM | 自定义自定义图标需在**getCustomChannelTitle**方法中设置文案,在**getCustomChannelWidget**方法中设定图标。如其中一个为空,则不显示自定义图标。 | +| 常量名 | 渠道名 | +| --------------------------------- | ------------------------------------------------------------ | +| BrnShareItemConstants.shareWeiXin | 微信 | +| BrnShareItemConstants.shareFriend | 朋友圈 | +| BrnShareItemConstants.shareQQ | qq | +| BrnShareItemConstants.shareQZone | qq空间 | +| BrnShareItemConstants.shareWeiBo | 微博 | +| BrnShareItemConstants.shareLink | 链接 | +| BrnShareItemConstants.shareSms | 短信 | +| BrnShareItemConstants.shareCustom | 自定义自定义图标需在**getCustomChannelTitle**方法中设置文案,在**getCustomChannelWidget**方法中设定图标。如其中一个为空,则不显示自定义图标。 | ## 四、代码演示 @@ -101,9 +101,9 @@ BrnShareDialog({ BrnShareDialog brnShareDialog = BrnShareDialog( context: context, shareChannels: [ - BrnShareItemConstants.SHARE_WEIXIN, - BrnShareItemConstants.SHARE_LINK, - BrnShareItemConstants.SHARE_CUSTOM + BrnShareItemConstants.shareWeiXin, + BrnShareItemConstants.shareLink, + BrnShareItemConstants.shareCustom ], titleText: "测试标题", descText: "测试辅助信息测试辅助信息测试辅助信息测试辅助信息测试辅助信息", @@ -134,11 +134,11 @@ brnShareDialog.show(); BrnShareDialog brnShareDialog = new BrnShareDialog( context: context, shareChannels: [ - BrnShareItemConstants.SHARE_WEIXIN, - BrnShareItemConstants.SHARE_CUSTOM, - BrnShareItemConstants.SHARE_CUSTOM, - BrnShareItemConstants.SHARE_LINK, - BrnShareItemConstants.SHARE_CUSTOM + BrnShareItemConstants.shareWeiXin, + BrnShareItemConstants.shareCustom, + BrnShareItemConstants.shareCustom, + BrnShareItemConstants.shareLink, + BrnShareItemConstants.shareCustom ], titleText: "测试标题", descText: "测试辅助信息测试辅助信息测试辅助信息测试辅助信息测试辅助信息", diff --git a/docs/components/dialog/BrnSingleSelectDialog/BrnSingleSelectDialog.md b/docs/components/dialog/BrnSingleSelectDialog/BrnSingleSelectDialog.md index 9c5242e8..b6d46bd4 100644 --- a/docs/components/dialog/BrnSingleSelectDialog/BrnSingleSelectDialog.md +++ b/docs/components/dialog/BrnSingleSelectDialog/BrnSingleSelectDialog.md @@ -24,35 +24,35 @@ group: ### 构造函数 ```dart -BrnSingleSelectDialog( - {this.isClose: true, - this.title: "", - this.conditions, - this.submitText: "提交", - this.submitBgColor, - this.onSubmitClick, - this.onItemClick, - this.checkedItem, - this.customWidget, - this.canDismissOnConfirmClick = true, - this.isCustomFollowScroll = true}); +const BrnSingleSelectDialog( + {this.isClose: true, + this.title: "", + required this.conditions, + this.submitText: "提交", + this.submitBgColor, + this.onSubmitClick, + this.onItemClick, + this.checkedItem, + this.customWidget, + this.canDismissOnConfirmClick = true, + this.isCustomFollowScroll = true}); ``` ### 参数说明 -| **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | -| ------------------------ | ----------------------------------------------- | --------------------------------------------------------- | ------------ | ---------- | -| isClose | bool | 用于控制弹窗是否相应电机外部关闭,true 关闭,false 不关闭 | 否 | true | -| title | String | 弹窗标题名称 | 否 | 无 | -| conditions | List | 备选项数组 | 否 | | -| checkedItem | String | 选中的选项名称 | 否 | | -| submitText | String | 确定/提交 按钮文案 | 否 | | -| submitBgColor | Color | 提交按钮背景颜色 | 否 | | -| customWidget | Widget | 在单选列表底部自定义 Widget | 否 | null | -| isCustomFollowScroll | bool | 内容是否可滑动 | 否 | true | -| canDismissOnConfirmClick | bool | 是否在点击时让 Diallog 消失 | 否 | true | -| onSubmitClick | Function(String data) | 提交按钮点击的回调 | 否 | | -| onItemClick | void Function( BuildContext context, int index) | item 的点击回调 | 否 | | +| **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | +| ------------------------ | ----------------------------------- | --------------------------------------------------------- | ------------ | ---------- | +| isClose | bool | 用于控制弹窗是否相应电机外部关闭,true 关闭,false 不关闭 | 否 | true | +| title | String | 弹窗标题名称 | 否 | "" | +| conditions | List | 备选项数组 | 否 | | +| checkedItem | String | 选中的选项名称 | 否 | | +| submitText | String | 确定/提交 按钮文案 | 否 | | +| submitBgColor | Color | 提交按钮背景颜色 | 否 | | +| customWidget | Widget | 在单选列表底部自定义 Widget | 否 | null | +| isCustomFollowScroll | bool | 内容是否可滑动 | 否 | true | +| canDismissOnConfirmClick | bool | 是否在点击时让 Diallog 消失 | 否 | true | +| onSubmitClick | BrnSingleSelectOnSubmitCallback? | 提交按钮点击的回调 | 否 | | +| onItemClick | BrnSingleSelectOnItemClickCallback? | item 的点击回调 | 否 | | ## 三、代码演示 @@ -92,7 +92,7 @@ String hintText = "感兴趣待跟进"; //光标圆角弧度 cursorRadius: Radius.circular(2.0), style: TextStyle(fontSize: 14, color: Color(0xFF222222)), - maxLengthEnforced: true, + maxLengthEnforcement: MaxLengthEnforcement.enforced, onChanged: (value) {}, decoration: InputDecoration( contentPadding: EdgeInsets.all(8.0), diff --git a/docs/components/iconButton/BrnIconButton/BrnIconButton.md b/docs/components/iconButton/BrnIconButton/BrnIconButton.md index fa31e9d7..b19b6fbd 100644 --- a/docs/components/iconButton/BrnIconButton/BrnIconButton.md +++ b/docs/components/iconButton/BrnIconButton/BrnIconButton.md @@ -27,22 +27,21 @@ group: ### 构造函数 ``` dart -BrnIconButton({ - Key key, - @required this.name, - this.iconWidget, - this.onTap, - this.iconWidth = 24, - this.iconHeight = 24, - this.fontSize = 11, - this.widgetWidth = 80, - this.widgetHeight = 80, - this.direction = Direction.top, - this.padding = 4, - this.style, - this.isGrey = true, - this.mainAxisAlignment = MainAxisAlignment.center, -}) : assert(isGrey != null); +const BrnIconButton({ + Key? key, + required this.name, + this.iconWidget, + this.onTap, + this.iconWidth = 24, + this.iconHeight = 24, + this.fontSize = 11, + this.widgetWidth = 80, + this.widgetHeight = 80, + this.direction = Direction.top, + this.padding = 4, + this.style, + this.mainAxisAlignment = MainAxisAlignment.center, + }): super(key: key); ``` ### 参数说明 @@ -50,16 +49,15 @@ BrnIconButton({ | 参数名 | 参数类型 | 描述 | 是否必填 | 默认值 | | ----------------- | -------------------------------------------- | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ | | name | String | 图文组合文字的名称 | 否 | 空 | -| isGrey | bool | 是否是置灰状态 | 否 | true | -| iconWidget | Widget | 图文组合需要展示的图片/可以是置灰的图片 | 否 | 空 | -| onTap | VoidCallback | 点击的回调 | 否 | 空 | +| iconWidget | Widget? | 图文组合需要展示的图片/可以是置灰的图片 | 否 | 空 | +| onTap | VoidCallback? | 点击的回调 | 否 | 空 | | direction | enum Direction { left, right, top, bottom, } | 文字相对于图片的位置。 bottom:文字在下 icon 在上, top:文字在上 icon 在下 ,left:文字在左 icon 在右,right:文字在右 icon 在左 | 否 | top | | iconWidth | double | 图片的宽度 | 否 | 24 | | iconHeight | Color | 图片的高度 | 否 | 24 | | widgetWidth | double | 图文组合的宽度 | 否 | 80 | | widgetHeight | double | 图文组合的高度 | 否 | 80 | | padding | double | 文字和图片的间距 | 否 | 4 | -| style | TextStyle | 文字样式 | 否 | TextStyle( fontSize: 11, color: BrunoColor.instance.F2Color, ), | +| style | TextStyle? | 文字样式 | 否 | TextStyle( fontSize: 11, color: BrunoColor.instance.F2Color, ), | | fontSize | double | 文字字体大小 | 否 | 11 | | mainAxisAlignment | MainAxisAlignment | 图文对齐方式 | 否 | MainAxisAlignment.center | diff --git a/docs/components/iconButton/BrnVerticalIconButton/BrnVerticalIconButton.md b/docs/components/iconButton/BrnVerticalIconButton/BrnVerticalIconButton.md index 67bdf5d1..050930a8 100644 --- a/docs/components/iconButton/BrnVerticalIconButton/BrnVerticalIconButton.md +++ b/docs/components/iconButton/BrnVerticalIconButton/BrnVerticalIconButton.md @@ -21,9 +21,12 @@ group: ```dart -BrnVerticalIconButton( - {Key key, @required this.name, @required this.iconWidget, this.onTap}) - : super(key: key) +const BrnVerticalIconButton({ + Key? key, + required this.name, + required this.iconWidget, + this.onTap, + }) : super(key: key); ``` ### 参数说明 @@ -32,7 +35,7 @@ BrnVerticalIconButton( | key | Key | 视图绑定的 key | 否 | 无 | | name | String | 需要显示的文案 | 是 | 无 | | iconWidget | Widget | 需要显示的图标 widget | 是 | 无 | -| onTap | VoidCallback | 按钮点击的回调处理 | 否 | 无 | +| onTap | VoidCallback? | 按钮点击的回调处理 | 否 | 无 | ## 四、代码演示 diff --git a/docs/components/input/BrnInputText/BrnInputText.md b/docs/components/input/BrnInputText/BrnInputText.md index 3170c722..10dbfdc8 100644 --- a/docs/components/input/BrnInputText/BrnInputText.md +++ b/docs/components/input/BrnInputText/BrnInputText.md @@ -28,49 +28,49 @@ group: ### 构造函数 ```dart -BrnInputText({ - this.onTextChange, - this.onSubmit, - this.maxHeight = 200, - this.minHeight = 50, - this.bgColor = Colors.white, - this.maxLength = 200, - this.minLines = 1, - this.hint = "请输入", - this.maxHintLines, - this.padding = EdgeInsets.zero, - this.textString = "", - this.autoFocus, - this.textEditingController, - this.focusNode, - this.textInputAction = TextInputAction.done, - this.borderRadius, - this.borderColor, -}); + BrnInputText({ + this.onTextChange, + this.onSubmit, + this.maxHeight = 200, + this.minHeight = 50, + this.bgColor = Colors.white, + this.maxLength = 200, + this.minLines = 1, + this.hint = "请输入", + this.maxHintLines, + this.padding = EdgeInsets.zero, + this.textString = "", + this.autoFocus, + this.textEditingController, + this.focusNode, + this.textInputAction = TextInputAction.done, + this.borderRadius, + this.borderColor, + }); ``` ### 参数说明 -| **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | -| --------------------- | --------------------------------------------------- | ------------------------------------------------------------ | ------------ | -------------------- | -| hint | String | 输入提示语,默认为"请输入..." | 否 | "请输入..." | -| textString | String | 输入框初始值 | 否 | "请输入..." | -| maxHintLines | 最大 hint 行数 | 最大 hint 行数 | | | -| textEditingController | TextEditingController | 用于对 TextField 更精细的控制,若传入该字段,[textString] 参数将失效,可使用 TextEditingController.text 进行赋值 | 否 | | -| onTextChange | BrnInputTextChangeCallback = Function(String input) | 搜索框输入内容改变时候的回调函数,str 为输入内容 | 否 | 无 | -| onSubmit | BrnInputTextSubmitCallback = Function(String input) | 输入内容点击确定后的回调,str 为输入内容 | 否 | 空 | -| maxHeight | double | 容器的最大高度、输入框最大可以伸缩的高度 | 否 | 空 | -| minHeight | double | 容器的最小高度、输入框最小可以伸缩的高度 | 否 | 空 | -| bgColor | Color | 整个容器的背景颜色 | 否 | 白色 | -| maxLength | int | 最大字数 | 否 | 200 | -| minLines | int | 最少几行、文字可以输入几行 | 否 | 1 | -| padding | EdgeInsetsGeometry | 文字离容器的上下左右的距离 | 否 | EdgeInsets.zero | -| borderColor | Color | 边框颜色 | 否 | | -| borderRadius | double | 背景圆角 | 否 | | -| autoFocus | bool | 光标展示 | 否 | | -| focusNode | FocusNode | 搜索框的焦点控制器 | 否 | | -| padding | EdgeInsetsGeometry | 文字距离边框的边距 | 否 | EdgeInsets.zero | -| textEditingController | TextInputAction | 键盘输入行为 | 否 | TextInputAction.done | +| **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | +| --------------------- | ---------------------------------------------------- | ------------------------------------------------------------ | ------------ | -------------------- | +| hint | String | 输入提示语,默认为"请输入..." | 否 | "请输入..." | +| textString | String | 输入框初始值 | 否 | "" | +| maxHintLines | int? | 最大 hint 行数 | | | +| textEditingController | TextEditingController? | 用于对 TextField 更精细的控制,若传入该字段,[textString] 参数将失效,可使用 TextEditingController.text 进行赋值 | 否 | | +| onTextChange | BrnInputTextChangeCallback = Function(String input)? | 搜索框输入内容改变时候的回调函数,str 为输入内容 | 否 | 无 | +| onSubmit | BrnInputTextSubmitCallback = Function(String input)? | 输入内容点击确定后的回调,str 为输入内容 | 否 | 空 | +| maxHeight | double | 容器的最大高度、输入框最大可以伸缩的高度 | 否 | 空 | +| minHeight | double | 容器的最小高度、输入框最小可以伸缩的高度 | 否 | 空 | +| bgColor | Color | 整个容器的背景颜色 | 否 | Colors.white | +| maxLength | int | 最大字数 | 否 | 200 | +| minLines | int | 最少几行、文字可以输入几行 | 否 | 1 | +| padding | EdgeInsetsGeometry | 文字离容器的上下左右的距离 | 否 | EdgeInsets.zero | +| borderColor | Color? | 边框颜色 | 否 | | +| borderRadius | double? | 背景圆角 | 否 | | +| autoFocus | bool? | 光标展示 | 否 | | +| focusNode | FocusNode | 搜索框的焦点控制器 | 否 | | +| padding | EdgeInsetsGeometry | 文字距离边框的边距 | 否 | EdgeInsets.zero | +| textEditingController | TextInputAction | 键盘输入行为 | 否 | TextInputAction.done | ## 三、效果及代码展示 @@ -82,23 +82,23 @@ BrnInputText({ ```dart BrnInputText( - maxHeight: 200, - minHeight: 30, - minLines: 1, - maxLength: 10, - bgColor: Colors.grey[200], - textString: model.text, - textInputAction: TextInputAction.newline, - maxHintLines: 20, - hint: 'input动态算高input动态算高input动态算高input动态算高input动态算高', - padding: EdgeInsets.fromLTRB(20, 10, 20, 14), - onTextChange: (text) { - print(text); - model.text = text; - setState(() {}); - }, - onSubmit: (text) { - print(text); - }, -); + maxHeight: 200, + minHeight: 30, + minLines: 1, + maxLength: 10, + bgColor: Colors.grey[200]!, + textString: model.text ?? '', + textInputAction: TextInputAction.newline, + maxHintLines: 20, + hint: 'input动态算高input动态算高input动态算高input动态算高input动态算高', + padding: EdgeInsets.fromLTRB(20, 10, 20, 14), + onTextChange: (text) { + print(text); + model.text = text; + setState(() {}); + }, + onSubmit: (text) { + print(text); + }, + ); ``` diff --git a/docs/components/loading/BrnPageLoading/BrnPageLoading.md b/docs/components/loading/BrnPageLoading/BrnPageLoading.md index 78bb7482..dde58c04 100644 --- a/docs/components/loading/BrnPageLoading/BrnPageLoading.md +++ b/docs/components/loading/BrnPageLoading/BrnPageLoading.md @@ -22,7 +22,8 @@ group: ### 构造函数 ```dart -BrnPageLoading({this.content}); + const BrnLoadingDialog({Key? key, this.content = BrnStrings.loadingContent}) + : super(key: key); ``` ### 参数配置 diff --git a/docs/components/normalButton/BrnBigGhostButton/BrnBigGhostButton.md b/docs/components/normalButton/BrnBigGhostButton/BrnBigGhostButton.md index 0fd4ac27..4b4df7f8 100644 --- a/docs/components/normalButton/BrnBigGhostButton/BrnBigGhostButton.md +++ b/docs/components/normalButton/BrnBigGhostButton/BrnBigGhostButton.md @@ -24,14 +24,14 @@ group: ```dart const BrnBigGhostButton({ - Key key, - this.title = '确认', - this.titleColor, - this.bgColor, - this.onTap, - this.width, - this.themeData, -}) : super(key: key); + Key? key, + this.title = '确认', + this.titleColor, + this.bgColor, + this.onTap, + this.width, + this.themeData, + }) : super(key: key); ``` ### 参数说明 @@ -42,6 +42,7 @@ const BrnBigGhostButton({ | bgColor | Color | 按钮的背景色 | 否 | 主题色为5透明度的颜色 | | width | double | 按钮的宽度 | 否 | double.infinity | | titleColor | Color | 按钮的文字颜色 | 否 | 主题色 | +| themeData | BrnButtonConfig | button主题定制 | 否 | 无 | diff --git a/docs/components/normalButton/BrnBigMainButton/BrnBigMainButton.md b/docs/components/normalButton/BrnBigMainButton/BrnBigMainButton.md index 5c09831f..7b4c1b70 100644 --- a/docs/components/normalButton/BrnBigMainButton/BrnBigMainButton.md +++ b/docs/components/normalButton/BrnBigMainButton/BrnBigMainButton.md @@ -26,14 +26,14 @@ group: ```dart const BrnBigMainButton({ - Key key, - this.title = '确认', - this.width, - this.isEnable = true, - this.onTap, - this.themeData, - this.bgColor, -}) : super(key: key); + Key? key, + this.title = '确认', + this.width, + this.isEnable = true, + this.onTap, + this.themeData, + this.bgColor, + }) : super(key: key); ``` ### 参数说明 @@ -44,6 +44,7 @@ const BrnBigMainButton({ | isEnable | bool | 按钮是否可用 | 否 | false | | bgColor | Color | 按钮的背景色 | 否 | 主题色 | | width | double | 按钮的宽度 | 否 | double.infinity | +| themeData | BrnButtonConfig | 按钮主题配置 | 否 | 无 | diff --git a/docs/components/normalButton/BrnBigOutlineButton/BrnBigOutlineButton.md b/docs/components/normalButton/BrnBigOutlineButton/BrnBigOutlineButton.md index 184e37db..3c33346b 100644 --- a/docs/components/normalButton/BrnBigOutlineButton/BrnBigOutlineButton.md +++ b/docs/components/normalButton/BrnBigOutlineButton/BrnBigOutlineButton.md @@ -25,15 +25,15 @@ group: ```dart const BrnBigOutlineButton({ - Key key, - this.title = '确认', - this.lineColor, - this.textColor, - this.isEnable = true, - this.width, - this.onTap, - this.themeData, -}) : super(key: key); + Key? key, + this.title = '确认', + this.lineColor, + this.textColor, + this.isEnable = true, + this.width, + this.onTap, + this.themeData, + }) : super(key: key); ``` ### 参数说明 @@ -45,6 +45,7 @@ const BrnBigOutlineButton({ | lineColor | Color | 边框颜色 | 否 | 主题色 | | textColor | Color | 按钮文本颜色 | 否 | 黑色 | | width | double | 按钮的宽度 | 否 | double.infinity | +| themeData | BrnButtonConfig | 按钮主题配置 | 否 | 无 | ## 四、效果及代码演示 diff --git a/docs/components/normalButton/BrnSmallMainButton/BrnSmallMainButton.md b/docs/components/normalButton/BrnSmallMainButton/BrnSmallMainButton.md index 5929217d..208a5334 100644 --- a/docs/components/normalButton/BrnSmallMainButton/BrnSmallMainButton.md +++ b/docs/components/normalButton/BrnSmallMainButton/BrnSmallMainButton.md @@ -24,34 +24,36 @@ group: ```dart const BrnSmallMainButton({ - this.title = '确认', - this.onTap, - this.isEnable = true, - this.textColor, - this.bgColor, - this.fontWeight, - this.fontSize, - this.radius, - this.maxWidth, - this.width, - this.themeData, -}); + Key? key, + this.title = '确认', + this.onTap, + this.isEnable = true, + this.bgColor, + this.textColor = Colors.white, + this.fontWeight = FontWeight.w600, + this.fontSize, + this.radius, + this.maxWidth, + this.width, + this.themeData, + }): super(key: key); ``` ### 参数说明 -| 参数名 | 参数类型 | 描述 | 是否必填 | 默认值 | -| ---------- | ------------ | -------------- | -------- | --------------- | -| title | String | 按钮显示文案 | 否 | 确认 | -| onTap | VoidCallback | 点击的回调 | 否 | 无 | -| isEnable | bool | 按钮是否可用 | 否 | True | -| bgColor | Color | 按钮的背景色 | 否 | 主题色 | -| width | double | 按钮的宽度 | 否 | double.infinity | -| textColor | Color | 文本的颜色 | 否 | 白色 | -| fontWeight | FontWeight | 文本的粗细 | 否 | bold | -| fontSize | double | 文字的大小 | 否 | 14 | -| radius | double | 按钮的圆角 | 否 | 4 | -| maxWidth | double | 按钮的最大宽度 | 否 | null | +| 参数名 | 参数类型 | 描述 | 是否必填 | 默认值 | +| ---------- | --------------- | -------------- | -------- | --------------- | +| title | String | 按钮显示文案 | 否 | 确认 | +| onTap | VoidCallback | 点击的回调 | 否 | 无 | +| isEnable | bool | 按钮是否可用 | 否 | True | +| bgColor | Color | 按钮的背景色 | 否 | 主题色 | +| width | double | 按钮的宽度 | 否 | double.infinity | +| textColor | Color | 文本的颜色 | 否 | 白色 | +| fontWeight | FontWeight | 文本的粗细 | 否 | bold | +| fontSize | double | 文字的大小 | 否 | 14 | +| radius | double | 按钮的圆角 | 否 | 4 | +| maxWidth | double | 按钮的最大宽度 | 否 | null | +| themeData | BrnButtonConfig? | 按钮主题配置 | 否 | 无 | ## 四、代码演示 diff --git a/docs/components/normalButton/BrnSmallOutlineButton/BrnSmallOutlineButton.md b/docs/components/normalButton/BrnSmallOutlineButton/BrnSmallOutlineButton.md index 6c6cff3f..83c3bcdd 100644 --- a/docs/components/normalButton/BrnSmallOutlineButton/BrnSmallOutlineButton.md +++ b/docs/components/normalButton/BrnSmallOutlineButton/BrnSmallOutlineButton.md @@ -24,17 +24,18 @@ group: ```dart const BrnSmallOutlineButton({ - this.title = '确认', - this.onTap, - this.isEnable = true, - this.lineColor, - this.textColor, - this.radius, - this.width, - this.fontSize = 14, - this.fontWeight, - this.themeData, -}); + Key? key, + this.title = '确认', + this.onTap, + this.isEnable = true, + this.lineColor, + this.textColor, + this.radius, + this.width, + this.fontSize = 14, + this.fontWeight = FontWeight.w600, + this.themeData, + }): super(key: key); ``` ### 参数说明 @@ -45,11 +46,11 @@ const BrnSmallOutlineButton({ | onTap | VoidCallback | 点击的回调 | 否 | 无 | | isEnable | bool | 按钮是否可用 | 否 | true | | lineColor | Color | 边框的背景色 | 否 | 主题色 | -| width | double | 按钮的宽度 | 否 | double.infinity | +| width | double | 按钮的宽度 | 否 | 无 | | textColor | Color | 文本的颜色 | 否 | 白色 | -| fontWeight | FontWeight | 文本的粗细 | 否 | bold | +| fontWeight | FontWeight | 文本的粗细 | 否 | FontWeight.w600 | | fontSize | double | 文字的大小 | 否 | 14 | -| radius | double | 按钮的圆角 | 否 | 4 | +| radius | double | 按钮的圆角 | 否 | 无 | ## 四、代码演示 diff --git a/docs/components/picker/BrnBottomPicker/BrnBottomPicker.md b/docs/components/picker/BrnBottomPicker/BrnBottomPicker.md index ab3e6698..ce16acb3 100644 --- a/docs/components/picker/BrnBottomPicker/BrnBottomPicker.md +++ b/docs/components/picker/BrnBottomPicker/BrnBottomPicker.md @@ -26,19 +26,21 @@ group: ``` dart static void show( - BuildContext context, { - @required contentWidget, - String title = '请选择', - dynamic confirm, - dynamic cancel, - Function() onConfirmClick, - Function() onCancelClick, - bool barrierDismissible = true, - bool cancelDismiss = true, - bool confirmDismiss = true, - bool showTitle = true, + BuildContext context, { + required contentWidget, + String title = '请选择', + dynamic confirm, + dynamic cancel, + VoidCallback? onConfirm, + VoidCallback? onCancel, + bool barrierDismissible = true, + bool showTitle = true, }) ``` + + + + ### 参数说明 | 参数名 | 参数类型 | 作用 | 是否必填 | 默认值 | @@ -48,13 +50,11 @@ static void show( | title | String | Picker的标题 | 否 | 请选择 | | confirm | dynamic | 标题的确认按钮UI,支持传入String或者Widget,默认是确认 | 否 | 确认 | | cancel | dynamic | 标题的取消按钮UI,支持传入String或者Widget,默认是确认 | 否 | 取消 | -| onConfirmClick | Function | 确认按钮点击的回调 | 否 | 否 | -| onCancelClick | Function | 取消按钮点击的回道 | 否 | 否 | +| onConfirm | VoidCallback? | 确认按钮点击的回调 | 否 | 否 | +| onCancel | VoidCallback? | 取消按钮点击的回道 | 否 | 否 | | rightTextColor | Color | 右侧文案 Color | 否 | 主题色 | | cursorColor | Color | 光标颜色 | 否 | 主题色 | | barrierDismissible | bool | 点击对话框外部 是否取消对话框 | 否 | true | -| cancelDismiss | bool | 点击 取消 之后是否自动关闭弹窗 | 否 | true | -| confirmDismiss | bool | 点击 确认 之后是否自动关闭弹窗 | 否 | true | | showTitle | bool | 是否展示标题 | 否 | true | ## 四、效果及代码展示 diff --git a/docs/components/picker/BrnBottomWritePicker/BrnBottomWritePicker.md b/docs/components/picker/BrnBottomWritePicker/BrnBottomWritePicker.md index e6ed02b7..792ba7d3 100644 --- a/docs/components/picker/BrnBottomWritePicker/BrnBottomWritePicker.md +++ b/docs/components/picker/BrnBottomWritePicker/BrnBottomWritePicker.md @@ -28,20 +28,18 @@ group: ### 构造函数 ```dart -BrnBottomWritePicker( - {this.maxLength = 200, - this.hintText = "请输入", - this.leftTag = "取消", - this.title = "", - this.rightTag = "确认", - this.cancel, - this.confirm, - this.confirmDismiss = false, - this.cancelDismiss = true, - this.rightTextColor, - this.cursorColor, - this.defaultText, - this.textEditingController}); +const BrnBottomWritePicker( + {this.maxLength = 200, + this.hintText = "请输入", + this.leftTag = "取消", + this.title = "", + this.rightTag = "确认", + this.onCancel, + this.onConfirm, + this.rightTextColor, + this.cursorColor, + this.defaultText, + this.textEditingController}); ``` ### 参数说明 @@ -53,14 +51,12 @@ BrnBottomWritePicker( | leftTag | String | 左侧按钮文案 | 否 | 取消 | | title | String | 标题文案 | 否 | | | rightTag | String | 右侧按钮文案 | 否 | 确认 | -| cancel | BrnBottomWritePickerClickCallback = Future Function(String content) | 取消输入事件回调 | 否 | | -| confirm | BrnBottomWritePickerConfirmClickCallback = Future Function( BuildContext dialogContext, String content) | 确认输入事件回调 | 否 | | -| rightTextColor | Color | 右侧文案 Color | 否 | 主题色 | -| cursorColor | Color | 光标颜色 | 否 | 主题色 | -| defaultText | String | 输入框默认文字 | 否 | | -| cancelDismiss | bool | 点击 取消 之后是否自动关闭弹窗 | 否 | true | -| confirmDismiss | bool | 点击 确认 之后是否自动关闭弹窗 | 否 | false | -| textEditingController | TextEditingController | 用于对 TextField 更精细的控制,若传入该字段,[defaultText] 参数将失效,可使用 TextEditingController.text 进行赋值 | 否 | | +| cancel | BrnBottomWritePickerClickCallback = Future Function(String content)? | 取消输入事件回调 | 否 | | +| confirm | BrnBottomWritePickerConfirmClickCallback = Future Function( BuildContext dialogContext, String content)? | 确认输入事件回调 | 否 | | +| rightTextColor | Color? | 右侧文案 Color | 否 | 主题色 | +| cursorColor | Color? | 光标颜色 | 否 | 主题色 | +| defaultText | String? | 输入框默认文字 | 否 | | +| textEditingController | TextEditingController? | 用于对 TextField 更精细的控制,若传入该字段,[defaultText] 参数将失效,可使用 TextEditingController.text 进行赋值 | 否 | | ## 四、效果及代码展示 diff --git a/docs/components/picker/BrnDatePicker/BrnDatePicker.md b/docs/components/picker/BrnDatePicker/BrnDatePicker.md index 3d7dd9c7..c595eb73 100644 --- a/docs/components/picker/BrnDatePicker/BrnDatePicker.md +++ b/docs/components/picker/BrnDatePicker/BrnDatePicker.md @@ -37,20 +37,20 @@ group: static void showDatePicker( BuildContext context, { bool rootNavigator = false, - bool canBarrierDismissible, - DateTime minDateTime, - DateTime maxDateTime, - DateTime initialDateTime, - String dateFormat, + bool? canBarrierDismissible, + DateTime? minDateTime, + DateTime? maxDateTime, + DateTime? initialDateTime, + String? dateFormat, int minuteDivider: 1, DateTimePickerLocale locale: DATETIME_PICKER_LOCALE_DEFAULT, BrnDateTimePickerMode pickerMode: BrnDateTimePickerMode.date, BrnPickerTitleConfig pickerTitleConfig, - DateVoidCallback onCancel, - DateVoidCallback onClose, - DateValueCallback onChange, - DateValueCallback onConfirm, - BrnPickerConfig themeData, + DateVoidCallback? onCancel, + DateVoidCallback? onClose, + DateValueCallback? onChange, + DateValueCallback? onConfirm, + BrnPickerConfig? themeData, }) ``` @@ -60,20 +60,20 @@ static void showDatePicker( | --- | --- | --- | --- | --- | | context | Buildcontext | | 是 | | | rootNavigator | bool | 是否使用根路由 | 否 | false | -| canBarrierDismissible | bool | 点击弹框外部区域能否消失 | 否 | | -| initialDateTime | DateTime | 初始选择的时间 | 否 | 当前时间 | -| minDateTime | DateTime | 能滚动到的最小日期 | 是 | minDateTime ≤ maxDateTime | -| maxDateTime | DateTime | 能滚动到的最大日期 | 是 | minDateTime ≤ maxDateTime | +| canBarrierDismissible | bool? | 点击弹框外部区域能否消失 | 否 | | +| initialDateTime | DateTime? | 初始选择的时间 | 否 | 当前时间 | +| minDateTime | DateTime? | 能滚动到的最小日期 | 否 | minDateTime ≤ maxDateTime | +| maxDateTime | DateTime? | 能滚动到的最大日期 | 否 | minDateTime ≤ maxDateTime | | locale | DateTimePickerLocale | 设置本地语言 | 否 | DateTimePickerLocale.zh\_cn | | pickerMode | BrnDateTimePickerMode | 时间选择组件显示的时间类型 | 否 | BrnDateTimePickerMode.date | -| pickerTitleConfig | BrnPickerTitleConfig | 时间选择组件的主题样式 | 否 | | -| dateFormat | String | 时间格式化的格式 | 是 | | -| onConfirm | DateValueCallback | 点击【完成】回调给调用方的数据 | 否 | | -| onCancel | DateVoidCallback | 点击【取消】回调给调用方的回调事件 | 否 | | -| onClose | DateVoidCallback | 弹框点击外围消失的回调事件 | 否 | | -| onChange | DateValueCallback | 时间滚动选择时候的回调事件 | 否 | | +| pickerTitleConfig | BrnPickerTitleConfig | 时间选择组件的主题样式 | 否 | BrnPickerTitleConfig.Default | +| dateFormat | String? | 时间格式化的格式 | 是 | | +| onConfirm | DateValueCallback? | 点击【完成】回调给调用方的数据 | 否 | | +| onCancel | DateVoidCallback? | 点击【取消】回调给调用方的回调事件 | 否 | | +| onClose | DateVoidCallback? | 弹框点击外围消失的回调事件 | 否 | | +| onChange | DateValueCallback? | 时间滚动选择时候的回调事件 | 否 | | | minuteDivider | int | 分钟间切换的差值 | 否 | 1 | -| themeData | BrnPickerConfig | picker配置 配置详见BrnPickerConfig | 否 | | +| themeData | BrnPickerConfig? | picker配置 配置详见BrnPickerConfig | 否 | | diff --git a/docs/components/picker/BrnDateRangePicker/BrnDateRangePicker.md b/docs/components/picker/BrnDateRangePicker/BrnDateRangePicker.md index 4c1b0db1..c2c3a4bb 100644 --- a/docs/components/picker/BrnDateRangePicker/BrnDateRangePicker.md +++ b/docs/components/picker/BrnDateRangePicker/BrnDateRangePicker.md @@ -41,22 +41,23 @@ group: ```dart static void showDatePicker( - BuildContext context, { - bool isDismissible, - DateTime minDateTime, - DateTime maxDateTime, - bool isLimitTimeRange, - DateTime initialStartDateTime, - DateTime initialEndDateTime, - String dateFormat, - int minuteDivider, - DateTimePickerLocale locale: DATETIME_PICKER_LOCALE_DEFAULT, - DateTimeRangePickerMode pickerMode: DateTimeRangePickerMode.date, - DateTimePickerTheme pickerTheme: DateTimePickerTheme.Default, - DateVoidCallback onCancel, - DateVoidCallback onClose, - DateRangeValueCallback onChange, - DateRangeValueCallback onConfirm, + BuildContext context, { + bool isDismissible = true, + DateTime? minDateTime, + DateTime? maxDateTime, + bool isLimitTimeRange = true, + DateTime? initialStartDateTime, + DateTime? initialEndDateTime, + String? dateFormat, + int minuteDivider = 1, + DateTimePickerLocale locale = datetimePickerLocaleDefault, + BrnDateTimeRangePickerMode pickerMode = BrnDateTimeRangePickerMode.date, + BrnPickerTitleConfig pickerTitleConfig = BrnPickerTitleConfig.Default, + DateVoidCallback? onCancel, + DateVoidCallback? onClose, + DateRangeValueCallback? onChange, + DateRangeValueCallback? onConfirm, + BrnPickerConfig? themeData, }) ``` ### 参数配置 @@ -64,21 +65,21 @@ static void showDatePicker( | **参数名** | **参数类型** | **作用** | **是否必填** | **默认值** | | --- | --- | --- | --- | --- | | isDismissible | bool | 用于控制弹窗是否相应电机外部关闭,true 关闭,false 不关闭 | 否 | true | -| minDateTime | DateTime | 时间区间最小值 | 否 | "1900-01-01 00:00:00" | -| maxDateTime | DateTime | 时间区间最大值 | 否 | "2100-12-31 23:59:59" | +| minDateTime? | DateTime | 时间区间最小值 | 否 | "1900-01-01 00:00:00" | +| maxDateTime? | DateTime | 时间区间最大值 | 否 | "2100-12-31 23:59:59" | | isLimitTimeRange | bool | 是否限制时间选择范围
true: 开始时间必须≤结束时间
false: 不限制开始时间,结束时间的值大小 | 否 | true | -| initialStartDateTime | DateTime | 初始设置选中的开始时间 | 否 | DateTime.now() | -| initialEndDateTime | DateTime | 初始设置选中的结束时间 | 否 | DateTime.now() | -| dateFormat | String | 展示格式,仅在pickerMode 为 DateTimeRangePickerMode.date时生效。可设置为”MM月-dd日“、”yyyy-年MM月-dd日“等年月日格式,将数据带上单位显示 | 否 | 'MM-dd' | +| initialStartDateTime | DateTime? | 初始设置选中的开始时间 | 否 | DateTime.now() | +| initialEndDateTime | DateTime? | 初始设置选中的结束时间 | 否 | DateTime.now() | +| dateFormat | String? | 展示格式,仅在pickerMode 为 DateTimeRangePickerMode.date时生效。可设置为”MM月-dd日“、”yyyy-年MM月-dd日“等年月日格式,将数据带上单位显示 | 否 | 'MM-dd' | | minuteDivider | int | 刻度值,仅在pickerMode 为DateTimeRangePickerMode.time时生效 | 否 | 1 | | locale | DateTimePickerLocale | 时区 | 否 | DateTimePickerLocale.zh\_cn | | pickerMode | DateTimeRangePickerMode | 要展示的时间范围选择类型,date 还是 time | 否 | DateTimeRangePickerMode.date | | pickerTitleConfig | `BrnPickerTitleConfig` | picker title 内容配置 | 否 | BrnPickerTitleConfig.Default | -| onCancel | DateVoidCallback | 取消回调 | 否 | | -| onClose | DateVoidCallback | 关闭回调 | 否 | | -| onChange | DateRangeValueCallback | 滚动变化回调 | 否 | | -| onConfirm | DateRangeValueCallback | 点击确定选中日期范围回调 | 否 | | -| themeData | BrnPickerConfig | 设置 Picker 相关主题 | 否 | BrnDefaultConfigUtils.defaultAllConfig.pickerConfig | +| onCancel | DateVoidCallback? | 取消回调 | 否 | | +| onClose | DateVoidCallback? | 关闭回调 | 否 | | +| onChange | DateRangeValueCallback? | 滚动变化回调 | 否 | | +| onConfirm | DateRangeValueCallback? | 点击确定选中日期范围回调 | 否 | | +| themeData | BrnPickerConfig? | 设置 Picker 相关主题 | 否 | BrnDefaultConfigUtils.defaultAllConfig.pickerConfig | ### 其它数据结构 diff --git a/docs/components/picker/BrnMultiColumnPicker/BrnMultiColumnPicker.md b/docs/components/picker/BrnMultiColumnPicker/BrnMultiColumnPicker.md index 0781a113..b674bbc6 100644 --- a/docs/components/picker/BrnMultiColumnPicker/BrnMultiColumnPicker.md +++ b/docs/components/picker/BrnMultiColumnPicker/BrnMultiColumnPicker.md @@ -25,7 +25,7 @@ ```dart BrnMultiColumnPicker( - {Key key, + {Key? key, @required this.entity, this.maxHeight = 280.0, this.showSelectedCount = false, @@ -68,16 +68,19 @@ enum PickerFilterType { ```dart class BrnPickerEntity { - String uniqueId; //唯一的id,可选 - String name; //筛选显示的文案 - String key; //回传给服务器的 key - String value; //回传给服务器的 value - String type; //类型 是单选、复选还是有自定义输入 - List children; //下级筛选项 - String defaultValue; //默认选中下一级的值,若 defaultValue 与 children 字段中筛选项的 value 值相同,则在数据初始化时将 isSelected 置为 true。 - Map extMap; //扩展字段,目前只有min和max,最大值,最小值范围;unit单位,例如居室、万,适配自定义区间填写的内容 - /// 支持最大选中个数,用于限制子节点可选中的最大个数。默认为 65535 + String? uniqueId; //唯一的id + String? type; //类型 目前支持的类型有不限(unlimit)、单选(radio)、复选(checkbox), 最终被解析成 PickerFilterType 类型 + String? key; //回传给服务器 + String? value; //回传给服务器 + String name; //显示的文案 + String? defaultValue; + List children; //下级筛选项 + Map? extMap; //扩展字段,目前只有min和max + + bool isSelected; //是否选中 int maxSelectedCount; + BrnPickerEntity? parent; //上级筛选项 + PickerFilterType? filterType; //筛选类型 } ``` @@ -95,8 +98,8 @@ rootBundle.loadString('assets/list_picker.json').then((data) { List _selectionData = List() ..addAll((JsonDecoder().convert(data)["data"]['list'] as List ?? []) .map((o) => BrnPickerEntity.fromMap(o))); - if (_selectionData != null && _selectionData.length > 0) { - _selectionData?.forEach((f) => f.configRelationshipAndDefaultValue()); + if (_selectionData.length > 0) { + _selectionData.forEach((f) => f.configRelationshipAndDefaultValue()); if (dataList.length == 0) { dataList.addAll(_selectionData); } diff --git a/docs/components/picker/BrnMultiDataPicker/BrnMultiDataPicker.md b/docs/components/picker/BrnMultiDataPicker/BrnMultiDataPicker.md index efb9cfc9..5e7c7d61 100644 --- a/docs/components/picker/BrnMultiDataPicker/BrnMultiDataPicker.md +++ b/docs/components/picker/BrnMultiDataPicker/BrnMultiDataPicker.md @@ -28,24 +28,24 @@ group: ```dart BrnMultiDataPickerWidget( - {Key key, - @required this.context, - @required this.delegate, - this.title = "", - this.titleTextStyle, - this.confirmTextStyle, - this.cancelTextStyle, - this.pickerTitles, - this.pickerTitleFontSize = 16, - this.pickerTitleColor = const Color(0XFF4A4E59), - this.textFontSize = 18, - this.textColor = const Color(0xff222222), - this.textSelectedColor, - this.behavior, - this.confirmClick, - this.createItemWidget, - this.sync = true, - this.themeData}) + {Key? key, + required this.context, + required this.delegate, + this.title = "", + this.titleTextStyle, + this.confirmTextStyle, + this.cancelTextStyle, + this.pickerTitles, + this.pickerTitleFontSize, + this.pickerTitleColor, + this.textFontSize, + this.textColor, + this.textSelectedColor, + this.behavior, + this.confirmClick, + this.createItemWidget, + this.themeData, + this.sync = true}) ``` ### 参数说明 @@ -54,21 +54,21 @@ BrnMultiDataPickerWidget( | --- | --- | --- | --- | --- | | context | Buildcontext | | 是 | | | delegate | BrnMultiDataPickerDelegate | 滚动组件每一列、每一行的具体内容设置,自定义delegate继承这个类,实现具体方法。 | 是 | | -| title | String | 滚动选择弹框的标题 | 否 | | -| titleTextStyle | TextStyle | 标题样式 | 否 | | -| confirmTextStyle | TextStyle | 确认文案样式 | 否 | | -| cancelTextStyle | TextStyle | 取消文案样式 | 否 | | -| pickerTitles | List | 多级数据选择每一级的默认标题 | 否 | 无 | -| pickerTitleFontSize | double | 多级数据选择每一级默认标题的字体大小 | 否 | 16 | -| pickerTitleColor | Color | 多级数据选择每一级默认标题的文案颜色 | 否 | Color(0XFF4A4E59) | -| textFontSize | double | 多级数据选择数据字体大小 | 否 | 18 | -| textColor | Color | 多级数据选择数据文案颜色 | 否 | Color(0xff222222) | -| textSelectedColor | Color | 多级数据选择数据选中文案颜色 | 否 | | -| behavior | ScrollBehavior | 选择轮盘的滚动行为 | 否 | | -| confirmClick | ConfirmButtonClick | 点击【完成】回调数据给调用方 | 否 | | -| createItemWidget | BrnMultiDataPickerCreateWidgetCallback | 返回自定义itemwidget | 否 | | +| title | String | 滚动选择弹框的标题 | 否 | "" | +| titleTextStyle | TextStyle? | 标题样式 | 否 | | +| confirmTextStyle | TextStyle? | 确认文案样式 | 否 | | +| cancelTextStyle | TextStyle? | 取消文案样式 | 否 | | +| pickerTitles | List? | 多级数据选择每一级的默认标题 | 否 | 无 | +| pickerTitleFontSize | double? | 多级数据选择每一级默认标题的字体大小 | 否 | 16 | +| pickerTitleColor | Color? | 多级数据选择每一级默认标题的文案颜色 | 否 | Color(0XFF4A4E59) | +| textFontSize | double? | 多级数据选择数据字体大小 | 否 | 18 | +| textColor | Color? | 多级数据选择数据文案颜色 | 否 | Color(0xff222222) | +| textSelectedColor | Color? | 多级数据选择数据选中文案颜色 | 否 | | +| behavior | ScrollBehavior? | 选择轮盘的滚动行为 | 否 | | +| confirmClick | ConfirmButtonClick? | 点击【完成】回调数据给调用方 | 否 | | +| createItemWidget | BrnMultiDataPickerCreateWidgetCallback? | 返回自定义itemwidget | 否 | | | sync | bool | 是否复位数据位置 | 否 | true | -| themeData | BrnPickerConfig | Picker配置类,配置详情见BrnPickerConfig | 否 | | +| themeData | BrnPickerConfig? | Picker配置类,配置详情见BrnPickerConfig | 否 | | ### 其它数据 @@ -158,7 +158,7 @@ class Brn1RowDelegate implements BrnMultiDataPickerDelegate { } @override - double rowHeightForComponent(int component) { + double? rowHeightForComponent(int component) { return PICKER_ITEM_HEIGHT; } @@ -283,7 +283,7 @@ class Brn1RowDelegate implements BrnMultiDataPickerDelegate { } @override - double rowHeightForComponent(int component) { + double? rowHeightForComponent(int component) { return null; } @@ -369,7 +369,7 @@ class Brn2RowDelegate implements BrnMultiDataPickerDelegate { } @override - double rowHeightForComponent(int component) { + double? rowHeightForComponent(int component) { return null; } @@ -483,7 +483,7 @@ class Brn2RowCustomDelegate implements BrnMultiDataPickerDelegate { } @override - double rowHeightForComponent(int component) { + double? rowHeightForComponent(int component) { return null; } diff --git a/docs/components/picker/BrnMultiSelectListPicker/BrnMultiSelectListPicker.md b/docs/components/picker/BrnMultiSelectListPicker/BrnMultiSelectListPicker.md index 252db42c..c14b2de8 100644 --- a/docs/components/picker/BrnMultiSelectListPicker/BrnMultiSelectListPicker.md +++ b/docs/components/picker/BrnMultiSelectListPicker/BrnMultiSelectListPicker.md @@ -32,25 +32,25 @@ group: ```dart BrnMultiSelectListPicker({ - Key key, - this.title, - this.items, - this.pickerTitleConfig = BrnPickerTitleConfig.Default, - this.onSubmit, - this.onCancel, - this.onItemClick, -}) + Key? key, + this.title, + required this.items, + this.pickerTitleConfig = BrnPickerTitleConfig.Default, + this.onSubmit, + this.onCancel, + this.onItemClick, + }) : super(key: key); ``` ### 参数说明 -| 参数名 | 参数类型 | 作用 | 是否必填 | 默认值 | -| ----------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------- | -------- | ---------------------------- | -| items | `List` | 数据源 | 是 | | -| pickerTitleConfig | BrnPickerTitleConfig | 设置 Picker 主题 | 否 | BrnPickerTitleConfig.Default | -| onSubmit | `BrnMultiSelectListPickerSubmit = bool Function(List checkedItems)` | 点击【完成】时回调给外部选中的数据 | 否 | | -| onItemClick | BrnMultiSelectListPickerItemClick = void Function(BuildContext context, int index) | Item 被点击的回调 | 否 | | -| isDismissible | bool | 是否可电机外部关闭弹窗,true 点击外部关闭弹窗 | 否 | true | +| 参数名 | 参数类型 | 作用 | 是否必填 | 默认值 | +| ----------------- | ------------------------------------------------------------ | --------------------------------------------- | -------- | ---------------------------- | +| items | `List` | 数据源 | 是 | | +| pickerTitleConfig | BrnPickerTitleConfig | 设置 Picker 主题 | 否 | BrnPickerTitleConfig.Default | +| onSubmit | `BrnMultiSelectListPickerSubmit = bool Function(List checkedItems)`? | 点击【完成】时回调给外部选中的数据 | 否 | | +| onItemClick | BrnMultiSelectListPickerItemClick = void Function(BuildContext context, int index)? | Item 被点击的回调 | 否 | | +| isDismissible | bool | 是否可电机外部关闭弹窗,true 点击外部关闭弹窗 | 否 | true | ### 其它数据结构 @@ -84,7 +84,7 @@ BrnPickerTitleConfig({ ```dart -List items = new List(); +List items = []; items.add(new BrnMultiSelectBottomPickerItem("100", "这里是标题1")); items.add(new BrnMultiSelectBottomPickerItem("101", "这里是标题2")); items.add(new BrnMultiSelectBottomPickerItem("102", "这里是标题3", isChecked: true)); @@ -112,7 +112,7 @@ BrnMultiSelectListPicker.show( ```dart -List items = new List(); +List items = []; items.add(new BrnMultiSelectBottomPickerItem("100", "这里是标题1")); items.add(new BrnMultiSelectBottomPickerItem("101", "这里是标题2")); items.add(new BrnMultiSelectBottomPickerItem("102", "这里是标题3", isChecked: true)); diff --git a/docs/components/picker/BrnMultiSelectTagsPicker/BrnMultiSelectTagsPicker.md b/docs/components/picker/BrnMultiSelectTagsPicker/BrnMultiSelectTagsPicker.md index 45fa8aa4..fc7b58ef 100644 --- a/docs/components/picker/BrnMultiSelectTagsPicker/BrnMultiSelectTagsPicker.md +++ b/docs/components/picker/BrnMultiSelectTagsPicker/BrnMultiSelectTagsPicker.md @@ -26,37 +26,36 @@ group: ```dart BrnMultiSelectTagsPicker({ - Key key, - @required this.context, - @required this.onConfirm, - this.onCancel, - @required this.tagPickerConfig, - @required this.onTagValueGetter, - this.onMaxSelectClick, - this.onItemClick, - this.maxSelectItemCount = 0, - this.brnCrossAxisCount, - this.itemHeight = 34.0, - this.layoutStyle = BrnMultiSelectTagsLayoutStyle.average, - BrnPickerTitleConfig pickerTitleConfig = BrnPickerTitleConfig.Default, - BrnPickerConfig themeData, -}) + Key? key, + required this.context, + required this.onConfirm, + this.onCancel, + required this.tagPickerConfig, + required this.onTagValueGetter, + this.onMaxSelectClick, + this.onItemClick, + this.maxSelectItemCount = 0, + this.crossAxisCount, + this.itemHeight = 34.0, + this.layoutStyle = BrnMultiSelectTagsLayoutStyle.average, + BrnPickerTitleConfig pickerTitleConfig = BrnPickerTitleConfig.Default, + BrnPickerConfig? themeData, + }) ``` ### 参数说明 | 参数名 | 参数类型 | 描述 | 是否必填 | 默认值 | | --- | --- | --- | --- | --- | | context | Buildcontext | | 是 | | -| headerBean | LJPickerHeaderBean | 设置弹框头部相关数据 | 否 | | | onConfirm | ValueChanged | 点击【完成】时回调给外部选中的数据 | 是 | | -| onCancel | VoidCallback | 点击【取消】时回调给外部的事件 | 否 | | +| onCancel | VoidCallback? | 点击【取消】时回调给外部的事件 | 否 | | | tagPickerConfig | BrnTagsPickerConfig | 设置弹框的tags数据,配置详情见BrnTagsPickerConfig | 否 | | | onTagValueGetter | TagValueGetter | 传入的泛型数据转换为字符串 以填充Widget | 是 | | -| crossAxisCount | int | 一行展示多少个item | 否 | | +| crossAxisCount | int? | 一行展示多少个item | 否 | | | maxSelectItemCount | int | 最大选中多少个item | 否 | 0 | | layoutStyle | BrnMultiSelectTagsLayoutStyle | 枚举.等分布局流式布局 | 否 | BrnMultiSelectTagsLayoutStyle.average | -| onMaxSelectClick | VoidCallback | 当点击到最大数目时的点击事件 | 否 | | -| onItemClick | BrnMultiSelectTagOnItemClick | 点击某个按钮的回调 | 否 | | +| onMaxSelectClick | VoidCallback? | 当点击到最大数目时的点击事件 | 否 | | +| onItemClick | BrnMultiSelectTagOnItemClick? | 点击某个按钮的回调 | 否 | | | itemHeight | double | item高度 | 否 | 34.0 | ### 其它数据 @@ -92,26 +91,27 @@ class BrnTagsPickerConfig { this.selectedTagBackgroudColor, this.chipPadding, this.tagItemSource = const []}) { - this.tagTitleColor = BrnThemeConfigurator.instance.getConfig().commonConfig.colorTextBase; + this.tagTitleColor = + BrnThemeConfigurator.instance.getConfig().commonConfig.colorTextBase; } ///tag 文字大小 double tagTitleFontSize; ///tag 文字颜色 - Color tagTitleColor; + Color? tagTitleColor; ///选中的tag颜色 - Color selectedTagTitleColor; + Color? selectedTagTitleColor; ///tag 背景颜色 - Color tagBackgroudColor; + Color? tagBackgroudColor; ///选中的颜色 - Color selectedTagBackgroudColor; + Color? selectedTagBackgroudColor; ///内部item的边距 - EdgeInsets chipPadding; + EdgeInsets? chipPadding; ///数据源 List tagItemSource; @@ -143,7 +143,7 @@ void _showMulSelectTagPicker(BuildContext context) { '可爱多', ]; - List items = List(); + List items = []; for (int i = 0; i < tags.length ;i++){ String it = tags[i]; BrnTagItemBean item = BrnTagItemBean(name: it,code: it,index: i, isSelect: true); diff --git a/docs/components/picker/BrnSelectTagsWithInputPicker/BrnSelectTagsWithInputPicker.md b/docs/components/picker/BrnSelectTagsWithInputPicker/BrnSelectTagsWithInputPicker.md index fa82b4a7..f8fac20e 100644 --- a/docs/components/picker/BrnSelectTagsWithInputPicker/BrnSelectTagsWithInputPicker.md +++ b/docs/components/picker/BrnSelectTagsWithInputPicker/BrnSelectTagsWithInputPicker.md @@ -39,19 +39,19 @@ group: ```dart -BrnSelectTagsWithInputPicker( - {this.maxLength = 200, - this.hintText = "请输入", - this.title = "", - this.confirm, - this.cancelCallBack, - this.cursorColor, - this.forceShowTextInput = false, - this.multiSelect = false, - this.defaultText, - this.textEditingController, - @required this.tagPickerConfig, - @required this.onTagValueGetter}); +const BrnSelectTagsWithInputPicker( + {this.maxLength = 200, + this.hintText = "请输入", + this.title = "", + this.confirm, + this.cancelCallBack, + this.cursorColor, + this.forceShowTextInput = false, + this.multiSelect = false, + this.defaultText, + this.textEditingController, + required this.tagPickerConfig, + required this.onTagValueGetter}); ``` ### 参数配置 @@ -60,15 +60,15 @@ BrnSelectTagsWithInputPicker( | title | String | Picker显示标题 | 否 | 空字符串 | | hintText | String | 默认输入框提示文本 | 否 | 请输入 | | maxLength | int | 输入框最长文本字符数 | 否 | 200 | -| confirm | BrnTagInputConfirmClickCallback | 点击“确定”按钮事件回调 | 否 | - | -| cancelCallBack | BrnTagInputCancelClickCallBack | 关闭Picker事件回调 | 否 | - | -| cursorColor | Color | 输入框光标颜色 | 否 | 主题色 | -| defaultText | String | 输入框默认文本 | 否 | 空字符串 | +| confirm | BrnTagInputConfirmClickCallback? | 点击“确定”按钮事件回调 | 否 | - | +| cancelCallBack | BrnTagInputCancelClickCallBack? | 关闭Picker事件回调 | 否 | - | +| cursorColor | Color? | 输入框光标颜色 | 否 | 主题色 | +| defaultText | String? | 输入框默认文本 | 否 | 空字符串 | | forceShowTextInput | bool | 强制显示输入框 | 否 | FALSE | | multiSelect | bool | 标签是否多选 | 否 | FALSE | | tagPickerConfig | BrnTagsInputPickerConfig | 标签数据源 | 是 | null | | onTagValueGetter | SelectTagWithInputValueGetter | 标签文案显示回调 | 是 | null | -| textEditingController | TextEditingController | 用于对 TextField 更精细的控制,若传入该字段,[defaultText] 参数将失效,可使用 TextEditingController.text 进行赋值 | 否 | | +| textEditingController | TextEditingController? | 用于对 TextField 更精细的控制,若传入该字段,[defaultText] 参数将失效,可使用 TextEditingController.text 进行赋值 | 否 | | ### 其他数据 @@ -77,10 +77,10 @@ BrnSelectTagsWithInputPicker( ```dart ///提交按钮事件回调 -typedef BrnTagInputConfirmClickCallback = Future Function( - BuildContext dialogContext, - List selectedTags, - String content); +typedef BrnTagInputConfirmClickCallback = Future? Function( + BuildContext dialogContext, + List? selectedTags, + String content); ``` #### BrnTagInputCancelClickCallBack @@ -88,7 +88,7 @@ typedef BrnTagInputConfirmClickCallback = Future Function( ```dart ///关闭 picker回调 -typedef BrnTagInputCancelClickCallBack = void Function(BuildContext context); +typedef BrnTagInputCancelClickCallBack = void Function(BuildContext context); ``` #### SelectTagWithInputValueGetter diff --git a/docs/components/tips/BrnPopupWindow/BrnPopupWindow.md b/docs/components/tips/BrnPopupWindow/BrnPopupWindow.md index df6c7526..45938484 100644 --- a/docs/components/tips/BrnPopupWindow/BrnPopupWindow.md +++ b/docs/components/tips/BrnPopupWindow/BrnPopupWindow.md @@ -29,23 +29,26 @@ group: ``` dart BrnPopupWindow(this.context, - {this.arrowHeight, - this.text, - this.popKey, - this.textStyle, - this.backgroundColor, - this.hasCloseIcon, - this.offset, - this.popDirection, - this.widget, - this.paddingInsets, - this.borderRadius, - this.canWrap = false, - this.spaceMargin, - this.borderColor, - this.arrowOffset, - this.onDismiss, - this.turnOverFromBottom = 50.0}) + {Key? key, + this.text, + required this.popKey, + this.arrowHeight = 6.0, + this.textStyle, + this.backgroundColor, + this.isShowCloseIcon = false, + this.offset = 0, + this.popDirection = BrnPopupDirection.bottom, + this.widget, + this.paddingInsets = + const EdgeInsets.only(left: 18, top: 14, right: 18, bottom: 14), + this.borderRadius = 4, + this.borderColor, + this.canWrap = false, + this.spaceMargin = 20, + this.arrowOffset, + this.onDismiss, + this.turnOverFromBottom = 50.0}) + : super(key: key); ``` @@ -54,23 +57,23 @@ BrnPopupWindow(this.context, | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | | --- | --- | --- | --- | --- | | context | BuildContext | 路由跳转Push和退出Pop的时候需要使用 | 是 | 无 | -| text | String | Tips的文本内容 | 是 | 无 | +| text | String? | Tips的文本内容 | 是 | 无 | | popKey | GlobalKey | 目标组件和当前组件传入的同一个GlobalKey值,便于计算目标组件位置等 | 是 | 无 | -| arrowHeight | double | 箭头的高度 | 否 | 6 | -| arrowOffset | double | 箭头偏移量 | 否 | arrowOffset = popKey 对应的 Widget 左右居中 - spaceMargin | -| textStyle | TextStyle | 显示的文本的样式 | 否 | TextStyle(fontSize: 16, color: Color(0xFFFFFFFF)) | -| backgroundColor | Color | Tips的背景颜色 | 否 | Color(0xFF1A1A1A) | +| arrowHeight | double | 箭头的高度 | 否 | 6.0 | +| arrowOffset | double? | 箭头偏移量 | 否 | arrowOffset = popKey 对应的 Widget 左右居中 - spaceMargin | +| textStyle | TextStyle? | 显示的文本的样式 | 否 | TextStyle(fontSize: 16, color: Color(0xFFFFFFFF)) | +| backgroundColor | Color? | Tips的背景颜色 | 否 | Color(0xFF1A1A1A) | | isShowCloseIcon | bool | 是否显示关闭图标 | 否 | false | | offset | double | Tips距离目标组件的偏移量 | 否 | 0 | | popDirection | PopDirection | 位于targetView的方向 | 否 | PopDirection.bottom | -| widget | Widget | 自定义显示的Widget | 否 | 无 | +| widget | Widget? | 自定义显示的Widget | 否 | 无 | | paddingInsets | EdgeInsets | Tips的内部Padding | 否 | EdgeInsets.only(left: 18, top: 14, right: 18, bottom: 14) | | borderRadius | double | Tips的外部圆角 | 否 | 4 | -| borderColor | Color | 边框颜色 | 否 | Colors.transparent | +| borderColor | Color? | 边框颜色 | 否 | Colors.transparent | | canWrap | bool | 是否能多行显示 默认false:单行显示 | 否 | false | | spaceMargin | double | Tips距离目标组件左右边线的距离 | 否 | 20 | -| onDismiss | VoidCallback | Tips消失时候的接口回调 | 否 | 无 | -| turnOverFromBottom | int | popWindow距离底部的距离小于此值的时候,自动将popWindow在targetView上面弹出 | 否 | 50 | +| onDismiss | VoidCallback? | Tips消失时候的接口回调 | 否 | 无 | +| turnOverFromBottom | double | popWindow距离底部的距离小于此值的时候,自动将popWindow在targetView上面弹出 | 否 | 50 | diff --git a/docs/components/toast/BrnToast/BrnToast.md b/docs/components/toast/BrnToast/BrnToast.md index 0ce8379b..ad2f7bb2 100644 --- a/docs/components/toast/BrnToast/BrnToast.md +++ b/docs/components/toast/BrnToast/BrnToast.md @@ -27,22 +27,34 @@ group: ```dart -static void show(String text, BuildContext context, - {int duration, - int gravity = BOTTOM, - Color backgroundColor = const Color(0xFF222222), - textStyle = const TextStyle(fontSize: 16, color: Colors.white), - double backgroundRadius = 5, - Image preIcon, - OnDismiss onDismiss}) +static void show( + String text, + BuildContext context, { + Duration? duration, + Color? background, + TextStyle? textStyle, + double? radius, + Image? preIcon, + double? verticalOffset, + VoidCallback? onDismiss, + BrnToastGravity? gravity, + }) ``` ```dart /// 显示在中间。如不设置duration则会自动根据内容长度来计算(更友好,最长5秒) -static void showInCenter(String text, BuildContext context, {int duration}) { - show(text, context, duration: duration, gravity: CENTER); -} +static void showInCenter( + {required String text, + required BuildContext context, + Duration? duration}) { + show( + text, + context, + duration: duration, + gravity: BrnToastGravity.center, + ); + } ``` ### 参数说明 @@ -51,12 +63,14 @@ static void showInCenter(String text, BuildContext context, {int duration}) { | --- | --- | --- | --- | --- | | text | String | 显示的文本 | 是 | 无 | | context | BuildContext | 创建OverlayState需要context | 是 | 无 | -| duration | int | Toast显示时间的长短 | 否 | BrnToast.LENGTH\_SHORT | -| gravity | int | Toast显示在顶部还是底部 | 否 | 0:显示在底部 | -| backgroundColor | Color | Toast的背景颜色 | 否 | Color(0xFF222222) | -| textStyle | TextStyle | Toast显示文本的样式 | 否 | TextStyle(fontSize: 16, color: Colors.white) | -| backgroundRadius | double | Toast的圆角大小 | 否 | 5 | -| preIcon | Image | 文字前面的图标 | 否 | 无 | +| duration | Duration? | Toast显示时间的长短 | 否 | BrnToast.LENGTH\_SHORT | +| gravity | BrnToastGravity? | Toast显示在顶部还是底部 | 否 | 0:显示在底部 | +| backgroundColor | Color? | Toast的背景颜色 | 否 | Color(0xFF222222) | +| textStyle | TextStyle? | Toast显示文本的样式 | 否 | TextStyle(fontSize: 16, color: Colors.white) | +| radius | double? | Toast的圆角大小 | 否 | 5 | +| preIcon | Image? | 文字前面的图标 | 否 | 无 | +| onDismiss | VoidCallback? | 是否可关闭 | 否 | 无 | +| verticalOffset | double? | 据中心偏移量 | 否 | 无 | ## 四、代码演示 @@ -74,14 +88,16 @@ BrnToast.show("共找到10932个结果", context, duration: BrnToast.LENGTH_LONG ```dart -BrnToast.show("失败文案", - context, - preIcon: Image.asset( - "assets/image/icon\_toast\_fail.png", - width: 24, - height: 24, - ), -duration: BrnToast.LENGTH_SHORT); +BrnToast.show( + "失败图标Toast", + context, + preIcon: Image.asset( + "assets/image/icon_toast_fail.png", + width: 24, + height: 24, + ), + duration: BrnDuration.short, + ); ``` ### 效果3:Toast/成功 @@ -91,12 +107,14 @@ duration: BrnToast.LENGTH_SHORT); ```dart -BrnToast.show("成功文案", - context, - preIcon: Image.asset( - "assets/image/icon\_toast\_success.png", - width: 24, - height: 24, - ), -duration: BrnToast.LENGTH_SHORT); +BrnToast.show( + "成功图标Toast", + context, + preIcon: Image.asset( + "assets/image/icon_toast_success.png", + width: 24, + height: 24, + ), + duration: BrnDuration.short, +); ``` diff --git a/example/lib/sample/components/button/brn_text_button_panel_example.dart b/example/lib/sample/components/button/brn_text_button_panel_example.dart index 0ebc055e..50cf4e80 100644 --- a/example/lib/sample/components/button/brn_text_button_panel_example.dart +++ b/example/lib/sample/components/button/brn_text_button_panel_example.dart @@ -26,7 +26,10 @@ class BrnTextButtonPanelExample extends StatelessWidget { text: '平分屏幕展示,不超过4个时全部展示,超过4个了,则只展示3个,剩余的放在更多里面', ), Text( - '正常案例', + '正常案例AAA', + textAlign: TextAlign.center, + overflow: TextOverflow.ellipsis, + maxLines: 1, style: TextStyle( color: Color(0xFF222222), fontSize: 18, diff --git a/lib/src/components/dialog/brn_dialog.dart b/lib/src/components/dialog/brn_dialog.dart index 44e06d0e..e3fb2adf 100644 --- a/lib/src/components/dialog/brn_dialog.dart +++ b/lib/src/components/dialog/brn_dialog.dart @@ -92,85 +92,6 @@ enum _ButtonType { right, } -/// 对话框的样式 -class BrnDialogStyle { - /// title的间距 - EdgeInsets? titlePadding; - - /// 主色调按钮样式 - TextStyle? mainTextStyle; - - /// 主色调按钮的背景 - Color? mainBackgroundColor; - - /// 其他按钮的样式 - TextStyle? greyActionsTextStyle; - - /// 其他按钮的背景 - Color? greyActionsBackgroundColor; - - /// 标题的文字样式 - TextStyle? titleTextStyle; - - /// 标题的文字对齐 - TextAlign? titleTextAlign; - - /// 内容文字的对齐 - TextAlign? contentTextAlign; - - /// 内容widget的间距 - EdgeInsets? contentPadding; - - /// 内容文字的样式 - TextStyle? contentTextStyle; - - /// 对话框的背景 - Color? backgroundColor; - - /// 对话框的底部按钮的高度 - double? bottomHeight; - - /// 对话框圆角的大小 - double? radius; - - /// 边框阴影 - double? elevation; - - /// 警示文案的样式 - TextStyle? warningTextStyle; - - /// 警示文案文字的对齐 - TextAlign? warningTextAlign; - - /// 警示文案的间距 - EdgeInsets? warningPadding; - - /// icon的间距 - EdgeInsets? iconPadding; - - /// 标题最大行数 - int? titleMaxLines; - - BrnDialogStyle({ - this.titlePadding, - this.titleTextAlign, - this.titleTextStyle, - this.contentPadding, - this.contentTextStyle, - this.warningTextStyle, - this.backgroundColor, - this.contentTextAlign, - this.mainBackgroundColor, - this.mainTextStyle, - this.greyActionsBackgroundColor, - this.greyActionsTextStyle, - this.bottomHeight, - this.warningPadding, - this.warningTextAlign, - this.iconPadding, - this.radius, - }); -} ///高度灵活的通用的弹窗组件 /// @@ -255,6 +176,7 @@ class BrnDialog extends AlertDialog { final int titleMaxLines; BrnDialog({ + Key? key, this.showIcon = false, this.iconImage, this.titleText, @@ -270,7 +192,7 @@ class BrnDialog extends AlertDialog { this.indexedActionCallback, this.themeData, this.titleMaxLines = cTitleMaxLines, - }); + }) : super(key: key); @override Widget build(BuildContext context) { @@ -676,7 +598,6 @@ class BrnDialogManager { String? warning, Widget? warningWidget, Widget? labelWidget, - BrnDialogStyle? dialogStyle, GestureTapCallback? onTap, bool barrierDismissible = true, int titleMaxLines = cTitleMaxLines, @@ -735,7 +656,6 @@ class BrnDialogManager { Widget? warningWidget, Widget? cancelWidget, Widget? conformWidget, - BrnDialogStyle? dialogStyle, GestureTapCallback? onCancel, GestureTapCallback? onConfirm, bool barrierDismissible = true, @@ -800,7 +720,6 @@ class BrnDialogManager { Widget? warningWidget, List? actionsWidget, bool barrierDismissible = true, - BrnDialogStyle? dialogStyle, int titleMaxLines = cTitleMaxLines, BrnDialogConfig? themeData, DialogIndexedActionClickCallback? indexedActionClickCallback, diff --git a/lib/src/components/dialog/brn_middle_input_diaolg.dart b/lib/src/components/dialog/brn_middle_input_diaolg.dart index ec66d2ff..35ae8b3c 100644 --- a/lib/src/components/dialog/brn_middle_input_diaolg.dart +++ b/lib/src/components/dialog/brn_middle_input_diaolg.dart @@ -26,9 +26,6 @@ class BrnMiddleInputDialog { /// 点击确定时的回调,参数为输入框中的字符 final void Function(String value)? onConfirm; - /// 弹窗样式。具体参见 [BrnDialogStyle] - final BrnDialogStyle? dialogStyle; - /// 点击取消时的回调 final VoidCallback? onCancel; @@ -72,7 +69,6 @@ class BrnMiddleInputDialog { this.textInputAction = TextInputAction.newline, this.cancelText = '取消', this.confirmText = '确定', - this.dialogStyle, this.onConfirm, this.onCancel, this.dismissOnActionsTap = true, @@ -162,7 +158,6 @@ class BrnMiddleInputDialog { confirm: confirmText, title: title, barrierDismissible: barrierDismissible, - dialogStyle: dialogStyle ?? BrnDialogStyle(), messageWidget: Padding( padding: const EdgeInsets.only(top: 12, left: 24, right: 24), child: Column( diff --git a/lib/src/components/picker/multi_range_picker/bean/brn_multi_column_picker_entity.dart b/lib/src/components/picker/multi_range_picker/bean/brn_multi_column_picker_entity.dart index b64f03df..f62db1ec 100644 --- a/lib/src/components/picker/multi_range_picker/bean/brn_multi_column_picker_entity.dart +++ b/lib/src/components/picker/multi_range_picker/bean/brn_multi_column_picker_entity.dart @@ -16,8 +16,7 @@ enum PickerWindowType { class BrnPickerEntity { String? uniqueId; //唯一的id - String? - type; //类型 目前支持的类型有不限(unlimit)、单选(radio)、复选(checkbox), 最终被解析成 PickerFilterType 类型 + String? type; //类型 目前支持的类型有不限(unlimit)、单选(radio)、复选(checkbox), 最终被解析成 PickerFilterType 类型 String? key; //回传给服务器 String? value; //回传给服务器 String name; //显示的文案