diff --git a/docs/components/abnormalCard/BrnAbnormalStateWidget/BrnAbnormalStateWidget.md b/docs/components/abnormalCard/BrnAbnormalStateWidget/BrnAbnormalStateWidget.md index 2a6f2f09..3d1d6bb2 100644 --- a/docs/components/abnormalCard/BrnAbnormalStateWidget/BrnAbnormalStateWidget.md +++ b/docs/components/abnormalCard/BrnAbnormalStateWidget/BrnAbnormalStateWidget.md @@ -57,7 +57,7 @@ BrnAbnormalStateWidget({ | img | Image | 图片 | 否 | | | title | String | 标题 | 否 | | | content | String | 内容 | 否 | | -| operateAreaType | enum OperateAreaType { SingleButton, DoubleButton, TextButton } | 操作区类型。SingleButton 为【单按钮】效果 DoubleButton 为【双按钮】效果 TextButton 为【文字链】效果 | 否 | OperateAreaType.TextButton | +| operateAreaType | enum OperateAreaType { singleButton, doubleButton, textButton } | 操作区类型。SingleButton 为【单按钮】效果 DoubleButton 为【双按钮】效果 TextButton 为【文字链】效果 | 否 | OperateAreaType.TextButton | | operateTexts | List | | | | | action | BrnEmptyStatusIndexedActionClickCallback = void Function(int index)index 点击的位置 | 点击回调,在 SingleButton 类型或者 enablePageTap = true 点击空白区域时返回 0;其他根据点击的位置返回。 | 否 | | | enablePageTap | bool | 空白区域是否可点击 | 否 | false | diff --git a/docs/components/form/BrnAddLabel/BrnAddLabel.md b/docs/components/form/BrnAddLabel/BrnAddLabel.md index aedf2e7f..a15e3676 100644 --- a/docs/components/form/BrnAddLabel/BrnAddLabel.md +++ b/docs/components/form/BrnAddLabel/BrnAddLabel.md @@ -39,7 +39,7 @@ BrnAddLabel({ | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.LABEL_ADD | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.labelAdd | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑false:禁用 | | onTap | VoidCallback | 可操作区点击回调 | 否 | 无 | | diff --git a/docs/components/form/BrnExpandFormGroup/BrnExpandFormGroup.md b/docs/components/form/BrnExpandFormGroup/BrnExpandFormGroup.md index f42833c2..a6bc1820 100644 --- a/docs/components/form/BrnExpandFormGroup/BrnExpandFormGroup.md +++ b/docs/components/form/BrnExpandFormGroup/BrnExpandFormGroup.md @@ -56,7 +56,7 @@ BrnExpandFormGroup({ | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.NORMAL_GROUP_TYPE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.normalGroupType | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | diff --git a/docs/components/form/BrnMultiChoiceInputFormItem/BrnMultiChoiceInputFormItem.md b/docs/components/form/BrnMultiChoiceInputFormItem/BrnMultiChoiceInputFormItem.md index ffc86c48..e42ccd61 100644 --- a/docs/components/form/BrnMultiChoiceInputFormItem/BrnMultiChoiceInputFormItem.md +++ b/docs/components/form/BrnMultiChoiceInputFormItem/BrnMultiChoiceInputFormItem.md @@ -47,7 +47,7 @@ BrnMultiChoiceInputFormItem({ this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: true, @@ -72,11 +72,11 @@ BrnMultiChoiceInputFormItem({ | **参数名** | 参数类型 | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType
.MULTI_CHOICE_PORTRAIT_INPUT_TYPE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.multiChoicePortraitInputType | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发 onTip 回调。 | 否 | 备注中类型 3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为 null 时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE_NORMAL2. 展示加号图标:BrnPrefixIconType.TYPE_ADD3. 展示减号图标:BrnPrefixIconType.TYPE_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal2. 展示加号图标:BrnPrefixIconType.add3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示\*图标) 默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑 false:禁用 | @@ -137,7 +137,7 @@ BrnMultiChoiceInputFormItem( ```dart BrnMultiChoiceInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "自然到访保护期", diff --git a/docs/components/form/BrnMultiChoicePortraitInputFormItem/BrnMultiChoicePortraitInputFormItem.md b/docs/components/form/BrnMultiChoicePortraitInputFormItem/BrnMultiChoicePortraitInputFormItem.md index c19f9515..9bb04350 100644 --- a/docs/components/form/BrnMultiChoicePortraitInputFormItem/BrnMultiChoicePortraitInputFormItem.md +++ b/docs/components/form/BrnMultiChoicePortraitInputFormItem/BrnMultiChoicePortraitInputFormItem.md @@ -48,7 +48,7 @@ BrnMultiChoicePortraitInputFormItem( this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -73,11 +73,11 @@ this.themeData = BrnThemeConfigurator.instance | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.MULTI_CHOICE_PORTRAIT_INPUT_TYPE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.multiChoicePortraitInputType | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE\_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE\_NORMAL 2. 展示加号图标:BrnPrefixIconType.TYPE\_ADD 3. 展示减号图标:BrnPrefixIconType.TYPE\_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal 2. 展示加号图标:BrnPrefixIconType.add 3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示`*`图标) 默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑false:禁用 | @@ -94,9 +94,9 @@ this.themeData = BrnThemeConfigurator.instance ###### BrnPrefixIconType: ```dart class BrnPrefixIconType { - static const String TYPE_NORMAL = "type_normal"; - static const String TYPE_ADD = "type_add"; - static const String TYPE_REMOVE = "type_remove"; + static const String normal = "type_normal"; + static const String add = "type_add"; + static const String remove = "type_remove"; } ``` ## 四、代码演示 @@ -138,7 +138,7 @@ BrnMultiChoicePortraitInputFormItem( ```dart BrnMultiChoicePortraitInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, error: "必填项不能为空", title: "自然到访保护期", diff --git a/docs/components/form/BrnNormalFormGroup/BrnNormalFormGroup.md b/docs/components/form/BrnNormalFormGroup/BrnNormalFormGroup.md index afd9cc19..3a1d2905 100644 --- a/docs/components/form/BrnNormalFormGroup/BrnNormalFormGroup.md +++ b/docs/components/form/BrnNormalFormGroup/BrnNormalFormGroup.md @@ -60,7 +60,7 @@ BrnNormalFormGroup({ | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | String | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.NORMAL_GROUP_TYPE | 外部可用此字段判断表单类型 | +| type | String | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.normalGroupType | 外部可用此字段判断表单类型 | | title | String | 录入项标题 | 否 | 无 | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | null | 1. 若赋值为 空字符串("")时仅展示"问号"图标,2. 若赋值为非空字符串时 展示"问号图标&文案",3. 若不赋值或赋值为null时 不显示提示项 | diff --git a/docs/components/form/BrnRadioInputFormItem/BrnRadioInputFormItem.md b/docs/components/form/BrnRadioInputFormItem/BrnRadioInputFormItem.md index 83fb480e..c799bf46 100644 --- a/docs/components/form/BrnRadioInputFormItem/BrnRadioInputFormItem.md +++ b/docs/components/form/BrnRadioInputFormItem/BrnRadioInputFormItem.md @@ -51,7 +51,7 @@ BrnRadioInputFormItem( this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -78,11 +78,10 @@ BrnRadioInputFormItem( | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.TYPE_NORMAL | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE_NORMAL 2. 展示加号图标:BrnPrefixIconType.TYPE_ADD3. 展示减号图标:BrnPrefixIconType.TYPE_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal 2. 展示加号图标:BrnPrefixIconType.add3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示*图标) 默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑false:禁用 | @@ -103,10 +102,10 @@ BrnRadioInputFormItem( ```dart -class BrnPrefixIconType { - static const String TYPE_NORMAL = "type_normal"; - static const String TYPE_ADD = "type_add"; - static const String TYPE_REMOVE = "type_remove"; +class BrnPrefixIconType { + static const String normal = "type_normal"; + static const String add = "type_add"; + static const String remove = "type_remove"; } ``` ## 四、代码演示 @@ -142,7 +141,7 @@ BrnRadioInputFormItem( ![](./img/BrnRadioInputFormItemDemo2.png) ```dart BrnRadioInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "自然到访保护期", @@ -173,7 +172,7 @@ BrnRadioInputFormItem( ![](./img/BrnRadioInputFormItemDemo3.png) ```dart BrnRadioInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, title: "自然到访保护期", subTitle: "这里是副标题", @@ -203,7 +202,7 @@ BrnRadioInputFormItem( ![](./img/BrnRadioInputFormItemDemo4.png) ```dart BrnRadioInputFormItem.autoLayout( - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, error: "必填项不能为空", title: "autoLayout", diff --git a/docs/components/form/BrnRadioPortraitInputFormItem/BrnRadioPortraitInputFormItem.md b/docs/components/form/BrnRadioPortraitInputFormItem/BrnRadioPortraitInputFormItem.md index b7f70a32..237dc555 100644 --- a/docs/components/form/BrnRadioPortraitInputFormItem/BrnRadioPortraitInputFormItem.md +++ b/docs/components/form/BrnRadioPortraitInputFormItem/BrnRadioPortraitInputFormItem.md @@ -46,7 +46,7 @@ BrnRadioPortraitInputFormItem( this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -73,11 +73,11 @@ BrnRadioPortraitInputFormItem( | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | -------------- | -------------------------- | ------------------------------------------------------------------ | ------------ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.RADIO_INPUT_TYPE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.radioInputType | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | 无 | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发 onTip 回调。 | 否 | 备注中类型 3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为 null 时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE_NORMAL2. 展示加号图标:BrnPrefixIconType.TYPE_ADD3. 展示减号图标:BrnPrefixIconType.TYPE_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal2. 展示加号图标:BrnPrefixIconType.add3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | 无 | | | isRequire | bool | 录入项是否为必填项(展示\*图标) 默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑 false:禁用 | @@ -96,9 +96,9 @@ BrnRadioPortraitInputFormItem( ```dart class BrnPrefixIconType { - static const String TYPE_NORMAL = "type_normal"; - static const String TYPE_ADD = "type_add"; - static const String TYPE_REMOVE = "type_remove"; + static const String normal = "type_normal"; + static const String add = "type_add"; + static const String remove = "type_remove"; } ``` @@ -138,7 +138,7 @@ BrnRadioPortraitInputFormItem( ```dart BrnRadioPortraitInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "自然到访保护期", diff --git a/docs/components/form/BrnRangeInputFormItem/BrnRangeInputFormItem.md b/docs/components/form/BrnRangeInputFormItem/BrnRangeInputFormItem.md index 65f5e8c0..19abd429 100644 --- a/docs/components/form/BrnRangeInputFormItem/BrnRangeInputFormItem.md +++ b/docs/components/form/BrnRangeInputFormItem/BrnRangeInputFormItem.md @@ -46,7 +46,7 @@ BrnRangeInputFormItem( this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -82,11 +82,10 @@ BrnRangeInputFormItem( | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.TYPE_NORMAL | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE_NORMAL 2. 展示加号图标:BrnPrefixIconType.TYPE_ADD 3. 展示减号图标:BrnPrefixIconType.TYPE_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal 2. 展示加号图标:BrnPrefixIconType.add 3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示`*`图标),默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑false:禁用 | @@ -114,25 +113,25 @@ BrnRangeInputFormItem( #### BrnPrefixIconType: ``` dart -class BrnPrefixIconType { - static const String TYPE_NORMAL = "type_normal"; - static const String TYPE_ADD = "type_add"; - static const String TYPE_REMOVE = "type_remove"; +class BrnPrefixIconType { + static const String normal = "type_normal"; + static const String add = "type_add"; + static const String remove = "type_remove"; } ``` #### BrnInputType ``` dart class BrnInputType { - static const String TEXT = "text"; - static const String MULTI_LINE = "multiline"; - static const String NUMBER = "number"; - static const String DECIMAL = "decimal"; - static const String PHONE = "phone"; - static const String DATE = "datetime"; - static const String EMAIL = "emailAddress"; - static const String URL = "url"; - static const String PWD = "visiblePassword"; + static const String text = "text"; + static const String multiLine = "multiline"; + static const String number = "number"; + static const String decimal = "decimal"; + static const String phone = "phone"; + static const String date = "datetime"; + static const String email = "emailAddress"; + static const String url = "url"; + static const String pwd = "visiblePassword"; } ``` ## 四、代码演示 @@ -178,7 +177,7 @@ BrnRangeInputFormItem( BrnRangeInputFormItem( minController: TextEditingController()..text = "10", maxController: TextEditingController()..text = "100", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "保护期", diff --git a/docs/components/form/BrnRatioInputFormItem/BrnRatioInputFormItem.md b/docs/components/form/BrnRatioInputFormItem/BrnRatioInputFormItem.md index c8e6d691..a6548d3f 100644 --- a/docs/components/form/BrnRatioInputFormItem/BrnRatioInputFormItem.md +++ b/docs/components/form/BrnRatioInputFormItem/BrnRatioInputFormItem.md @@ -44,7 +44,7 @@ BrnRatioInputFormItem( this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -72,11 +72,11 @@ BrnRatioInputFormItem( | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.TEXT_INPUT_RATIO_TYPE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.textInputRatioType | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE_NORMAL 2. 展示加号图标:BrnPrefixIconType.TYPE_ADD 3. 展示减号图标:BrnPrefixIconType.TYPE_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal 2. 展示加号图标:BrnPrefixIconType.add 3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示`*`图标) 默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑,false:禁用 | diff --git a/docs/components/form/BrnStarsFormItem/BrnStarsFormItem.md b/docs/components/form/BrnStarsFormItem/BrnStarsFormItem.md index b6a280fb..d98d3e3d 100644 --- a/docs/components/form/BrnStarsFormItem/BrnStarsFormItem.md +++ b/docs/components/form/BrnStarsFormItem/BrnStarsFormItem.md @@ -41,7 +41,7 @@ BrnStarsFormItem( this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -66,11 +66,11 @@ BrnStarsFormItem( | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.STAR_INPUT_TYPE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.starInputType | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE\_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE\_NORMAL 2. 展示加号图标:BrnPrefixIconType.TYPE\_ADD 3. 展示减号图标:BrnPrefixIconType.TYPE\_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal 2. 展示加号图标:BrnPrefixIconType.add 3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示`*`图标) 默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑false:禁用 | diff --git a/docs/components/form/BrnStepInputFormItem/BrnStepInputFormItem.md b/docs/components/form/BrnStepInputFormItem/BrnStepInputFormItem.md index f388bbd6..b97f5f2d 100644 --- a/docs/components/form/BrnStepInputFormItem/BrnStepInputFormItem.md +++ b/docs/components/form/BrnStepInputFormItem/BrnStepInputFormItem.md @@ -42,7 +42,7 @@ BrnStepInputFormItem( this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -69,11 +69,10 @@ BrnStepInputFormItem( | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.TYPE_NORMAL | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE\_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE\_NORMAL 2. 展示加号图标:BrnPrefixIconType.TYPE\_ADD 3. 展示减号图标:BrnPrefixIconType.TYPE\_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal 2. 展示加号图标:BrnPrefixIconType.add 3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示`*`图标) 默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑false:禁用 | diff --git a/docs/components/form/BrnTextBlockInputFormItem/BrnTextBlockInputFormItem.md b/docs/components/form/BrnTextBlockInputFormItem/BrnTextBlockInputFormItem.md index 5c764ac7..4c07ac49 100644 --- a/docs/components/form/BrnTextBlockInputFormItem/BrnTextBlockInputFormItem.md +++ b/docs/components/form/BrnTextBlockInputFormItem/BrnTextBlockInputFormItem.md @@ -43,11 +43,11 @@ group: BrnTextBlockInputFormItem( {Key key, this.label, - this.type: BrnInputItemType.TEXT_BLOCK_INPUT_TYPE, + this.type: BrnInputItemType.textBlockInputType, this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -77,11 +77,11 @@ BrnTextBlockInputFormItem( | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.TEXT_BLOCK_INPUT_TYPE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.textBlockInputType | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE_NORMAL 2. 展示加号图标:BrnPrefixIconType.TYPE_ADD3. 展示减号图标:BrnPrefixIconType.TYPE_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal 2. 展示加号图标:BrnPrefixIconType.add3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示`*`图标) 默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑false:禁用 | @@ -106,26 +106,26 @@ BrnTextBlockInputFormItem( ```dart -class BrnPrefixIconType { - static const String TYPE_NORMAL = "type_normal"; - static const String TYPE_ADD = "type_add"; - static const String TYPE_REMOVE = "type_remove"; +class BrnPrefixIconType { + static const String normal = "type_normal"; + static const String add = "type_add"; + static const String remove = "type_remove"; } ``` #### BrnInputType -```dart r +```dart class BrnInputType { - static const String TEXT = "text"; - static const String MULTI_LINE = "multiline"; - static const String NUMBER = "number"; - static const String DECIMAL = "decimal"; - static const String PHONE = "phone"; - static const String DATE = "datetime"; - static const String EMAIL = "emailAddress"; - static const String URL = "url"; - static const String PWD = "visiblePassword"; + static const String text = "text"; + static const String multiLine = "multiline"; + static const String number = "number"; + static const String decimal = "decimal"; + static const String phone = "phone"; + static const String date = "datetime"; + static const String email = "emailAddress"; + static const String url = "url"; + static const String pwd = "visiblePassword"; } ``` ## 四、代码演示 @@ -160,7 +160,7 @@ BrnTextBlockInputFormItem( ```dart BrnTextBlockInputFormItem( controller: TextEditingController()..text = "hello", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: true, error: "必填项不能为空", @@ -189,7 +189,7 @@ BrnTextBlockInputFormItem( ```dart BrnTextBlockInputFormItem( controller: TextEditingController()..text = "hello", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: true, title: "备注", @@ -217,7 +217,7 @@ BrnTextBlockInputFormItem( ```dart BrnTextBlockInputFormItem( controller: TextEditingController()..text = "hello", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: false, isPrefixIconEnabled: true, diff --git a/docs/components/form/BrnTextInputFormItem/BrnTextInputFormItem.md b/docs/components/form/BrnTextInputFormItem/BrnTextInputFormItem.md index ca77d8f8..284cc1ba 100644 --- a/docs/components/form/BrnTextInputFormItem/BrnTextInputFormItem.md +++ b/docs/components/form/BrnTextInputFormItem/BrnTextInputFormItem.md @@ -43,11 +43,11 @@ group: BrnTextInputFormItem({ Key key, this.label, - this.type: BrnInputItemType.TEXT_INPUT_TYPE, + this.type: BrnInputItemType.textInputType, this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -77,11 +77,11 @@ BrnTextInputFormItem({ | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.TEXT_INPUT_TYPE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.textInputType | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE\_NORMAL 2. 展示加号图标:BrnPrefixIconType.TYPE_ADD 3. 展示减号图标:BrnPrefixIconType.TYPE\_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal 2. 展示加号图标:BrnPrefixIconType.add 3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示`*`图标) 默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑false:禁用 | @@ -158,7 +158,7 @@ BrnTextInputFormItem( ```dart BrnTextInputFormItem( controller: TextEditingController()..text = "300", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: true, error: "必填项不能为空", @@ -188,7 +188,7 @@ BrnTextInputFormItem( ```dart BrnTextInputFormItem( controller: TextEditingController()..text = "300", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: true, title: "房屋总价", @@ -217,7 +217,7 @@ BrnTextInputFormItem( ```dart BrnTextInputFormItem( controller: TextEditingController()..text = "300", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: false, isPrefixIconEnabled: true, diff --git a/docs/components/form/BrnTextQuickSelectFormItem/BrnTextQuickSelectFormItem.md b/docs/components/form/BrnTextQuickSelectFormItem/BrnTextQuickSelectFormItem.md index cbc675e5..b174a09a 100644 --- a/docs/components/form/BrnTextQuickSelectFormItem/BrnTextQuickSelectFormItem.md +++ b/docs/components/form/BrnTextQuickSelectFormItem/BrnTextQuickSelectFormItem.md @@ -39,7 +39,7 @@ BrnTextQuickSelectFormItem( this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -69,14 +69,14 @@ BrnTextQuickSelectFormItem( | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.TEXT_QUICK_SELECT_INPUT_TYPE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.textQuickSelectInputType | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示`*`图标) 默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑false:禁用 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 BrnPrefixIconType 类 | 否 | BrnPrefixIconType.TYPE\_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE\_NORMAL2. 展示加号图标:BrnPrefixIconType.TYPE\_ADD3. 展示减号图标:BrnPrefixIconType.TYPE\_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 BrnPrefixIconType 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal2. 展示加号图标:BrnPrefixIconType.add3. 展示减号图标:BrnPrefixIconType.remove | | isBtnsScroll | bool | 快捷按钮是否可滑动 | 否 | 无 | true:可滚动false:不可滚动 | | btnsTxt | List | 按钮文案 | 否 | 无 | | | selectBtnList | List | 按钮是否默认选中 | 否 | 无 | true:选中false:未选中 | @@ -150,7 +150,7 @@ List options = ['选项1', '选项2', '选项3', '选项4']; List statusAllFunctionDemo = [false, false, false, false]; BrnTextQuickSelectFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, btnsTxt: options, selectBtnList: statusAllFunctionDemo, diff --git a/docs/components/form/BrnTextSelectFormItem/BrnTextSelectFormItem.md b/docs/components/form/BrnTextSelectFormItem/BrnTextSelectFormItem.md index bf41b71b..3cfee756 100644 --- a/docs/components/form/BrnTextSelectFormItem/BrnTextSelectFormItem.md +++ b/docs/components/form/BrnTextSelectFormItem/BrnTextSelectFormItem.md @@ -40,7 +40,7 @@ BrnTextSelectFormItem({ this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -68,7 +68,7 @@ BrnTextSelectFormItem({ | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.TEXT_SELECT_INPUT_TYPE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.textSelectInputType | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | @@ -92,10 +92,10 @@ BrnTextSelectFormItem({ #### BrnPrefixIconType: ```dart -class BrnPrefixIconType{ - static const String TYPE_NORMAL = "type_normal"; - static const String TYPE_ADD = "type_add"; - static const String TYPE_REMOVE = "type_remove"; +class BrnPrefixIconType { + static const String normal = "type_normal"; + static const String add = "type_add"; + static const String remove = "type_remove"; } ``` ## 四、代码演示 @@ -125,7 +125,7 @@ BrnTextSelectFormItem( ![](./img/BrnTextSelectFormItemDemo2.png) ```dart BrnTextSelectFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "证件类型", @@ -151,7 +151,7 @@ BrnTextSelectFormItem( ```dart BrnTextSelectFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, title: "证件类型", subTitle: "这里是副标题", @@ -176,7 +176,7 @@ BrnTextSelectFormItem( ```dart BrnTextSelectFormItem.autoLayout( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "证件类型", diff --git a/docs/components/form/BrnTitleFormItem/BrnTitleFormItem.md b/docs/components/form/BrnTitleFormItem/BrnTitleFormItem.md index ac2f6d85..68776bf8 100644 --- a/docs/components/form/BrnTitleFormItem/BrnTitleFormItem.md +++ b/docs/components/form/BrnTitleFormItem/BrnTitleFormItem.md @@ -32,7 +32,7 @@ BrnTitleFormItem( this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -53,11 +53,11 @@ BrnTitleFormItem( | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.LABEL_TITLE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.labelTitle | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE\_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE\_NORMAL2. 展示加号图标:BrnPrefixIconType.TYPE\_ADD3. 展示减号图标:BrnPrefixIconType.TYPE\_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal2. 展示加号图标:BrnPrefixIconType.add3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示`*`图标), 默认为 false 不必填 | 否 | false | | | isEdit | bool | 录入项 是否可编辑 | 否 | true | true:可编辑,false:禁用 | diff --git a/docs/components/form/BrnTitleSelectInputFormItem/BrnTitleSelectInputFormItem.md b/docs/components/form/BrnTitleSelectInputFormItem/BrnTitleSelectInputFormItem.md index fe8f77d6..810e1cd3 100644 --- a/docs/components/form/BrnTitleSelectInputFormItem/BrnTitleSelectInputFormItem.md +++ b/docs/components/form/BrnTitleSelectInputFormItem/BrnTitleSelectInputFormItem.md @@ -44,7 +44,7 @@ BrnTitleSelectInputFormItem( this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -76,11 +76,11 @@ BrnTitleSelectInputFormItem( | **参数名** | **参数类型** | **描述** | **是否必填** | **默认值** | **备注** | | --- | --- | --- | --- | --- | --- | | label | String | 录入项的唯一标识,主要用于录入类型页面框架中 | 否 | 无 | | -| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType
.TEXT_INPUT_TITLE_SELECT_TYPE | 外部可根据此字段判断表单项类型 | +| type | Stirng | 录入项类型,主要用于录入类型页面框架中 | 否 | BrnInputItemType.textInputTitleSelectType | 外部可根据此字段判断表单项类型 | | title | String | 录入项标题 | 否 | '' | | | subTitle | String | 录入项子标题 | 否 | 无 | | | tipLabel | String | 录入项提示(问号图标&文案) 用户点击时触发onTip回调。 | 否 | 备注中类型3 | 1. 设置"空字符串"时展示问号图标 2. 设置"非空字符串"时展示问号图标&文案 3. 若不赋值或赋值为null时,不显示提示项 | -| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.TYPE_NORMAL | 1. 不展示图标:BrnPrefixIconType.TYPE_NORMAL 2. 展示加号图标:BrnPrefixIconType.TYPE_ADD 3. 展示减号图标:BrnPrefixIconType.TYPE_REMOVE | +| prefixIconType | String | 录入项前缀图标样式 "添加项" "删除项" 详见 **BrnPrefixIconType** 类 | 否 | BrnPrefixIconType.normal | 1. 不展示图标:BrnPrefixIconType.normal 2. 展示加号图标:BrnPrefixIconType.add 3. 展示减号图标:BrnPrefixIconType.remove | | error | String | 录入项错误提示 | 否 | '' | | | isRequire | bool | 录入项是否为必填项(展示`*`图标) 默认为 false 不必填 | 否 | false | | | isPrefixIconEnabled | bool | 录入项不可编辑时(isEdit: false) "+"、"-"号是否可点击,true: 可点击回调false: 不可点击回调 | 否 | false | | @@ -104,9 +104,9 @@ BrnTitleSelectInputFormItem( ```dart class BrnPrefixIconType { - static const String TYPE_NORMAL = "type_normal"; - static const String TYPE_ADD = "type_add"; - static const String TYPE_REMOVE = "type_remove"; + static const String normal = "type_normal"; + static const String add = "type_add"; + static const String remove = "type_remove"; } ``` @@ -114,15 +114,15 @@ class BrnPrefixIconType { ```dart class BrnInputType { - static const String TEXT = "text"; - static const String MULTI_LINE = "multiline"; - static const String NUMBER = "number"; - static const String DECIMAL = "decimal"; - static const String PHONE = "phone"; - static const String DATE = "datetime"; - static const String EMAIL = "emailAddress"; - static const String URL = "url"; - static const String PWD = "visiblePassword"; + static const String text = "text"; + static const String multiLine = "multiline"; + static const String number = "number"; + static const String decimal = "decimal"; + static const String phone = "phone"; + static const String date = "datetime"; + static const String email = "emailAddress"; + static const String url = "url"; + static const String pwd = "visiblePassword"; } ``` @@ -174,7 +174,7 @@ _list.add('手机号'); _list.add('座机'); BrnTitleSelectInputFormItem( controller: TextEditingController()..text = "124", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: false, error: "必填项不能为空", diff --git a/docs/components/picker/BrnMultiColumnPicker/BrnMultiColumnPicker.md b/docs/components/picker/BrnMultiColumnPicker/BrnMultiColumnPicker.md index 23bba47b..0781a113 100644 --- a/docs/components/picker/BrnMultiColumnPicker/BrnMultiColumnPicker.md +++ b/docs/components/picker/BrnMultiColumnPicker/BrnMultiColumnPicker.md @@ -58,9 +58,9 @@ BrnMultiColumnPicker( ```dart enum PickerFilterType { - None, //未设置 - Radio, //单选项,对应 type 为 radio - Checkbox, //多选项,对应 type 为 checkbox + none, //未设置 + radio, //单选项,对应 type 为 radio + checkbox, //多选项,对应 type 为 checkbox } ``` diff --git a/docs/components/selection/BrnSelectionView/BrnSelectionView.md b/docs/components/selection/BrnSelectionView/BrnSelectionView.md index 3ce81f6d..8e84a036 100644 --- a/docs/components/selection/BrnSelectionView/BrnSelectionView.md +++ b/docs/components/selection/BrnSelectionView/BrnSelectionView.md @@ -107,40 +107,40 @@ BrnSelectionView( ```dart enum BrnSelectionFilterType { /// 未设置 - None, + none, /// 不限类型 - UnLimit, + unLimit, /// 单选列表、单选项 type 为 radio - Radio, + radio, /// 多选列表、多选项 type 为 checkbox - Checkbox, + checkbox, /// 一般的值范围自定义区间 type 为 range - Range, + range, /// 日期选择,普通筛选时使用 CalendarView 展示选择时间,更多情况下使用 DatePicker 选择时间 - Date, + date, /// 自定义选择日期区间, type 为 dateRange - DateRange, + dateRange, /// 自定义通过 Calendar 选择日期区间,type 为 dateRangeCalendar - DateRangeCalendar, + dateRangeCalendar, /// 标签筛选 type 为 customerTag - CustomHandle, + customHandle, /// 更多列表、多选项 无 type - More, + more, /// 去二级页面 - Layer, + layer, /// 去自定义二级页面 - CustomLayer, + customLayer, } ``` @@ -165,8 +165,8 @@ enum BrnSelectionFilterType { ```dart enum SelectionWindowType { - List, //列表类型筛选弹窗,使用列表展示。 - Range, //标签类型筛选弹窗,使用 Tag + Range 的方式展示 + list, //列表类型筛选弹窗,使用列表展示。 + range, //标签类型筛选弹窗,使用 Tag + Range 的方式展示 } ``` diff --git a/example/lib/sample/components/appraise/appraise_example.dart b/example/lib/sample/components/appraise/appraise_example.dart index 8c064f02..8cb7791d 100644 --- a/example/lib/sample/components/appraise/appraise_example.dart +++ b/example/lib/sample/components/appraise/appraise_example.dart @@ -67,7 +67,7 @@ class _AppraiseExampleState extends State { BrnAppraise( title: "这里是标题文字", headerType: BrnAppraiseHeaderType.center, - type: BrnAppraiseType.Star, + type: BrnAppraiseType.star, tags: tags, inputHintText: '这里是文本输入的组件', iconDescriptions: [ @@ -172,7 +172,7 @@ class _AppraiseExampleState extends State { }, ///必须传入5个字符串,没有的位置传'' - type: BrnAppraiseType.Emoji, + type: BrnAppraiseType.emoji, iconDescriptions: ['很差', '', '可以', '', '非常好'], config: BrnAppraiseConfig( indexes: [0, 2, 4], titleMaxLines: 3), @@ -206,7 +206,7 @@ class _AppraiseExampleState extends State { showToast(index, list, input, context); Navigator.pop(context); }, - type: BrnAppraiseType.Star, + type: BrnAppraiseType.star, iconDescriptions: ['很差', '不行', '可以', '好'], config: BrnAppraiseConfig( showTextInput: false, diff --git a/example/lib/sample/components/calendar/calendarview_example.dart b/example/lib/sample/components/calendar/calendarview_example.dart index 98271855..25e9f568 100644 --- a/example/lib/sample/components/calendar/calendarview_example.dart +++ b/example/lib/sample/components/calendar/calendarview_example.dart @@ -59,7 +59,7 @@ class TagViewExamplePageState extends State { Widget _calendarViewWeekNocontroll(context) { return BrnCalendarView.single( - displayMode: DisplayMode.Week, + displayMode: DisplayMode.week, showControllerBar: false, dateChange: (date) { BrnToast.show('选中的时间: $date', context); @@ -69,7 +69,7 @@ class TagViewExamplePageState extends State { Widget _calendarViewWeekNocontrollCustomWeekName(context) { return BrnCalendarView.single( - displayMode: DisplayMode.Week, + displayMode: DisplayMode.week, showControllerBar: false, weekNames: ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], dateChange: (date) { @@ -80,7 +80,7 @@ class TagViewExamplePageState extends State { Widget _calendarViewWeek(context) { return BrnCalendarView.single( - displayMode: DisplayMode.Week, + displayMode: DisplayMode.week, initDisplayDate: DateTime.parse('2020-06-01'), minDate: DateTime(2020), maxDate: DateTime(2021), @@ -92,7 +92,7 @@ class TagViewExamplePageState extends State { Widget _calendarViewWeekRange(context) { return BrnCalendarView.range( - displayMode: DisplayMode.Week, + displayMode: DisplayMode.week, rangeDateChange: (rangeDate) { BrnToast.show( '开始时间: ${rangeDate.start} , 结束时间:${rangeDate.end}', context); diff --git a/example/lib/sample/components/card/content/number_item_example.dart b/example/lib/sample/components/card/content/number_item_example.dart index fcf2a48d..c70e25a0 100644 --- a/example/lib/sample/components/card/content/number_item_example.dart +++ b/example/lib/sample/components/card/content/number_item_example.dart @@ -62,7 +62,7 @@ class _NumberItemRowExampleState extends State { number: '3', preDesc: '前', lastDesc: '后', - numberInfoIcon: BrnNumberInfoIcon.ARROW, + numberInfoIcon: BrnNumberInfoIcon.arrow, iconTapCallBack: (data) {}), ], ), @@ -81,7 +81,7 @@ class _NumberItemRowExampleState extends State { number: '3', preDesc: '前', lastDesc: '后', - numberInfoIcon: BrnNumberInfoIcon.ARROW, + numberInfoIcon: BrnNumberInfoIcon.arrow, iconTapCallBack: (data) { BrnToast.show(data.title!, context); }), diff --git a/example/lib/sample/components/charts/chart_entry_example.dart b/example/lib/sample/components/charts/chart_entry_example.dart index c1fbf4ec..64dd6ea0 100644 --- a/example/lib/sample/components/charts/chart_entry_example.dart +++ b/example/lib/sample/components/charts/chart_entry_example.dart @@ -55,7 +55,7 @@ class _FunnelChartExampleState extends State { child: Column( children: [ BrnFunnelChart( - shape: FunnelShape.LeftOrRight, + shape: FunnelShape.leftOrRight, alignment: MarkerAlignment.right, maxLayerWidth: maxLayerWidth, minLayerWidth: minLayerWidth, @@ -84,7 +84,7 @@ class _FunnelChartExampleState extends State { height: 10, ), BrnFunnelChart( - shape: FunnelShape.LeftAndRight, + shape: FunnelShape.leftAndRight, alignment: alignment, maxLayerWidth: maxLayerWidth, minLayerWidth: minLayerWidth, diff --git a/example/lib/sample/components/empty/abnormal_state_example.dart b/example/lib/sample/components/empty/abnormal_state_example.dart index 6cf113ca..9ec98bd5 100644 --- a/example/lib/sample/components/empty/abnormal_state_example.dart +++ b/example/lib/sample/components/empty/abnormal_state_example.dart @@ -29,7 +29,7 @@ class AbnomalStateExample extends StatelessWidget { isCenterVertical: true, title: BrnStrings.getDateFailed, operateTexts: [BrnStrings.clickPageRetry], - operateAreaType: OperateAreaType.TextButton, + operateAreaType: OperateAreaType.textButton, action: (index) { BrnToast.show(BrnStrings.getDateFailed, context); }, @@ -71,7 +71,7 @@ class AbnomalStateExample extends StatelessWidget { ), title: "这是副标题内容这是副标题内容这是副标", content: '您的门店暂无用户', - operateAreaType: OperateAreaType.SingleButton, + operateAreaType: OperateAreaType.singleButton, operateTexts: ["切换账号"], action: (_) { BrnToast.show("第$_个按钮被点击了", context); @@ -86,7 +86,7 @@ class AbnomalStateExample extends StatelessWidget { ), title: "暂无", content: '您还没有在维护的信息哦', - operateAreaType: OperateAreaType.DoubleButton, + operateAreaType: OperateAreaType.doubleButton, operateTexts: ['去添加', '去修改'], action: (_) { BrnToast.show("第$_个按钮被点击了", context); diff --git a/example/lib/sample/components/form/items_example/multi_choice_example.dart b/example/lib/sample/components/form/items_example/multi_choice_example.dart index b7ea227f..204e8f4b 100644 --- a/example/lib/sample/components/form/items_example/multi_choice_example.dart +++ b/example/lib/sample/components/form/items_example/multi_choice_example.dart @@ -58,7 +58,7 @@ class MultiChoiceInputExamplePage extends StatelessWidget { ), ), BrnMultiChoiceInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "自然", @@ -97,7 +97,7 @@ class MultiChoiceInputExamplePage extends StatelessWidget { ), ), BrnMultiChoiceInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, title: "自然到", subTitle: "这里是副标题", diff --git a/example/lib/sample/components/form/items_example/multi_choice_protrait_example.dart b/example/lib/sample/components/form/items_example/multi_choice_protrait_example.dart index c200a947..e74e91aa 100644 --- a/example/lib/sample/components/form/items_example/multi_choice_protrait_example.dart +++ b/example/lib/sample/components/form/items_example/multi_choice_protrait_example.dart @@ -62,7 +62,7 @@ class MultiChoicePortraitInputExamplePage extends StatelessWidget { ), ), BrnMultiChoicePortraitInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, error: "必填项不能为空", title: "自然到访保护期", @@ -103,7 +103,7 @@ class MultiChoicePortraitInputExamplePage extends StatelessWidget { ), ), BrnMultiChoicePortraitInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, title: "自然到访保护期", subTitle: "这里是副标题", diff --git a/example/lib/sample/components/form/items_example/radio_input_example.dart b/example/lib/sample/components/form/items_example/radio_input_example.dart index e516dba3..f05edb6e 100644 --- a/example/lib/sample/components/form/items_example/radio_input_example.dart +++ b/example/lib/sample/components/form/items_example/radio_input_example.dart @@ -57,7 +57,7 @@ class RadioInputExamplePage extends StatelessWidget { ), ), BrnRadioInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "自然到访保护期", @@ -92,7 +92,7 @@ class RadioInputExamplePage extends StatelessWidget { ), ), BrnRadioInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, title: "自然到访保护期", subTitle: "这里是副标题", @@ -126,7 +126,7 @@ class RadioInputExamplePage extends StatelessWidget { ), ), BrnRadioInputFormItem.autoLayout( - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, error: "必填项不能为空", title: "autoLayout", diff --git a/example/lib/sample/components/form/items_example/radio_protrait_example.dart b/example/lib/sample/components/form/items_example/radio_protrait_example.dart index 15d71f2b..b4c3949d 100644 --- a/example/lib/sample/components/form/items_example/radio_protrait_example.dart +++ b/example/lib/sample/components/form/items_example/radio_protrait_example.dart @@ -58,7 +58,7 @@ class RadioPortraitInputExamplePage extends StatelessWidget { ), ), BrnRadioPortraitInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "自然到访保护期", @@ -95,7 +95,7 @@ class RadioPortraitInputExamplePage extends StatelessWidget { ), ), BrnRadioPortraitInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, title: "自然到访保护期", subTitle: "这里是副标题", diff --git a/example/lib/sample/components/form/items_example/range_input_example.dart b/example/lib/sample/components/form/items_example/range_input_example.dart index dc3f3bee..0e207851 100644 --- a/example/lib/sample/components/form/items_example/range_input_example.dart +++ b/example/lib/sample/components/form/items_example/range_input_example.dart @@ -36,7 +36,7 @@ class RangeInputExamplePage extends StatelessWidget { maxUnit: "天", leftMaxCount: 1, rightMaxCount: 3, - inputType: BrnInputType.NUMBER, + inputType: BrnInputType.number, onTip: () { BrnToast.show("点击触发onTip回调", context); }, @@ -66,7 +66,7 @@ class RangeInputExamplePage extends StatelessWidget { BrnRangeInputFormItem( minController: TextEditingController()..text = "10", maxController: TextEditingController()..text = "100", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "保护期", @@ -79,7 +79,7 @@ class RangeInputExamplePage extends StatelessWidget { maxUnit: "天", leftMaxCount: 1, rightMaxCount: 3, - inputType: BrnInputType.NUMBER, + inputType: BrnInputType.number, onTip: () { BrnToast.show("点击触发onTip回调", context); }, @@ -109,7 +109,7 @@ class RangeInputExamplePage extends StatelessWidget { BrnRangeInputFormItem( minController: TextEditingController()..text = "10", maxController: TextEditingController()..text = "100", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, title: "保护期", subTitle: "这里是副标题", @@ -121,7 +121,7 @@ class RangeInputExamplePage extends StatelessWidget { maxUnit: "天", leftMaxCount: 2, rightMaxCount: 3, - inputType: BrnInputType.NUMBER, + inputType: BrnInputType.number, onTip: () { BrnToast.show("点击触发onTip回调", context); }, @@ -151,7 +151,7 @@ class RangeInputExamplePage extends StatelessWidget { BrnRangeInputFormItem( minController: TextEditingController()..text = "10", maxController: TextEditingController()..text = "100", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, title: "保护期", subTitle: "这里是副标题", @@ -164,7 +164,7 @@ class RangeInputExamplePage extends StatelessWidget { maxUnit: "天", leftMaxCount: 2, rightMaxCount: 3, - inputType: BrnInputType.NUMBER, + inputType: BrnInputType.number, onTip: () { BrnToast.show("点击触发onTip回调", context); }, diff --git a/example/lib/sample/components/form/items_example/ratio_input_example.dart b/example/lib/sample/components/form/items_example/ratio_input_example.dart index d70b608a..5d374d59 100644 --- a/example/lib/sample/components/form/items_example/ratio_input_example.dart +++ b/example/lib/sample/components/form/items_example/ratio_input_example.dart @@ -54,7 +54,7 @@ class RatioInputExamplePage extends StatelessWidget { ), BrnRatioInputFormItem( controller: TextEditingController()..text = "1.6", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: true, error: "必填项不能为空", @@ -86,7 +86,7 @@ class RatioInputExamplePage extends StatelessWidget { ), BrnRatioInputFormItem( controller: TextEditingController()..text = "1.6", - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, isEdit: true, title: "车位比", @@ -117,7 +117,7 @@ class RatioInputExamplePage extends StatelessWidget { ), BrnRatioInputFormItem( controller: TextEditingController()..text = "1.6", - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, isEdit: false, isPrefixIconEnabled: true, diff --git a/example/lib/sample/components/form/items_example/star_example.dart b/example/lib/sample/components/form/items_example/star_example.dart index 59aa73ff..d9f2f43f 100644 --- a/example/lib/sample/components/form/items_example/star_example.dart +++ b/example/lib/sample/components/form/items_example/star_example.dart @@ -54,7 +54,7 @@ class StarInputExamplePage extends StatelessWidget { ), ), BrnStarsFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: true, error: "必填项不能为空", @@ -87,7 +87,7 @@ class StarInputExamplePage extends StatelessWidget { ), ), BrnStarsFormItem( - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, isEdit: true, title: "自然到访保护期", diff --git a/example/lib/sample/components/form/items_example/step_input_example.dart b/example/lib/sample/components/form/items_example/step_input_example.dart index d07e7feb..07a92d2f 100644 --- a/example/lib/sample/components/form/items_example/step_input_example.dart +++ b/example/lib/sample/components/form/items_example/step_input_example.dart @@ -56,7 +56,7 @@ class StepInputExamplePage extends StatelessWidget { ), ), BrnStepInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: true, error: "必填项不能为空", @@ -89,7 +89,7 @@ class StepInputExamplePage extends StatelessWidget { ), ), BrnStepInputFormItem( - prefixIconType: BrnPrefixIconType.TYPE_REMOVE, + prefixIconType: BrnPrefixIconType.remove, isRequire: true, isEdit: true, title: "自然到访保护期", diff --git a/example/lib/sample/components/form/items_example/text_block_input_example.dart b/example/lib/sample/components/form/items_example/text_block_input_example.dart index 81685dc1..9d05ba9f 100644 --- a/example/lib/sample/components/form/items_example/text_block_input_example.dart +++ b/example/lib/sample/components/form/items_example/text_block_input_example.dart @@ -57,7 +57,7 @@ class TextBlockInputExamplePage extends StatelessWidget { ), BrnTextBlockInputFormItem( controller: TextEditingController()..text = "hello", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: true, error: "必填项不能为空", @@ -90,7 +90,7 @@ class TextBlockInputExamplePage extends StatelessWidget { ), BrnTextBlockInputFormItem( controller: TextEditingController()..text = "hello", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: true, title: "备注", @@ -122,7 +122,7 @@ class TextBlockInputExamplePage extends StatelessWidget { ), BrnTextBlockInputFormItem( controller: TextEditingController()..text = "hello", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: false, isPrefixIconEnabled: true, diff --git a/example/lib/sample/components/form/items_example/text_input_example.dart b/example/lib/sample/components/form/items_example/text_input_example.dart index 08dfe421..2e3037d8 100644 --- a/example/lib/sample/components/form/items_example/text_input_example.dart +++ b/example/lib/sample/components/form/items_example/text_input_example.dart @@ -56,7 +56,7 @@ class TextInputExamplePage extends StatelessWidget { ), BrnTextInputFormItem( controller: TextEditingController()..text = "300", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: true, error: "必填项不能为空", @@ -90,7 +90,7 @@ class TextInputExamplePage extends StatelessWidget { ), BrnTextInputFormItem( controller: TextEditingController()..text = "300", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: true, title: "房屋总价", @@ -123,7 +123,7 @@ class TextInputExamplePage extends StatelessWidget { ), BrnTextInputFormItem( controller: TextEditingController()..text = "300", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: false, isPrefixIconEnabled: true, diff --git a/example/lib/sample/components/form/items_example/text_quick_select_input_example.dart b/example/lib/sample/components/form/items_example/text_quick_select_input_example.dart index 4666fa35..28698733 100644 --- a/example/lib/sample/components/form/items_example/text_quick_select_input_example.dart +++ b/example/lib/sample/components/form/items_example/text_quick_select_input_example.dart @@ -94,7 +94,7 @@ class _TextQuickSelectInputExamplePageState ), ), BrnTextQuickSelectFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, btnsTxt: options, selectBtnList: statusAllFunctionExample, diff --git a/example/lib/sample/components/form/items_example/text_select_example.dart b/example/lib/sample/components/form/items_example/text_select_example.dart index 44437767..7a689bbd 100644 --- a/example/lib/sample/components/form/items_example/text_select_example.dart +++ b/example/lib/sample/components/form/items_example/text_select_example.dart @@ -53,7 +53,7 @@ class TextSelectInputExamplePage extends StatelessWidget { ), ), BrnTextSelectFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "证件类型", @@ -83,7 +83,7 @@ class TextSelectInputExamplePage extends StatelessWidget { ), ), BrnTextSelectFormItem( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, title: "证件类型", subTitle: "这里是副标题", @@ -112,7 +112,7 @@ class TextSelectInputExamplePage extends StatelessWidget { ), ), BrnTextSelectFormItem.autoLayout( - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, error: "必填项不能为空", title: "证件类型", diff --git a/example/lib/sample/components/form/items_example/title_select_example.dart b/example/lib/sample/components/form/items_example/title_select_example.dart index a629dd6c..afaff9d7 100644 --- a/example/lib/sample/components/form/items_example/title_select_example.dart +++ b/example/lib/sample/components/form/items_example/title_select_example.dart @@ -83,7 +83,7 @@ class TitleSelectInputState extends State { ), BrnTitleSelectInputFormItem( controller: TextEditingController()..text = "124", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: false, error: "必填项不能为空", @@ -121,7 +121,7 @@ class TitleSelectInputState extends State { ), BrnTitleSelectInputFormItem( controller: TextEditingController()..text = "124", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: false, subTitle: "这里是副标题", @@ -158,7 +158,7 @@ class TitleSelectInputState extends State { ), BrnTitleSelectInputFormItem( controller: TextEditingController()..text = "不可编辑时+ -号可点击", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: false, isPrefixIconEnabled: false, @@ -197,7 +197,7 @@ class TitleSelectInputState extends State { ), BrnTitleSelectInputFormItem( controller: TextEditingController()..text = "不可编辑时+ -号可点击", - prefixIconType: BrnPrefixIconType.TYPE_ADD, + prefixIconType: BrnPrefixIconType.add, isRequire: true, isEdit: false, isPrefixIconEnabled: true, diff --git a/example/lib/sample/components/selection/selectionview_date_range_example_page.dart b/example/lib/sample/components/selection/selectionview_date_range_example_page.dart index 78beaac4..25979345 100644 --- a/example/lib/sample/components/selection/selectionview_date_range_example_page.dart +++ b/example/lib/sample/components/selection/selectionview_date_range_example_page.dart @@ -58,7 +58,7 @@ class _SelectionViewExamplePageState extends State { /// 获取评分组件 Widget _getIconWidget() { - if (widget.type == BrnAppraiseType.Emoji) { + if (widget.type == BrnAppraiseType.emoji) { return BrnAppraiseEmojiListView( indexes: widget.config.indexes, titles: widget.iconDescriptions, diff --git a/lib/src/components/appraise/brn_appraise_bottom_picker.dart b/lib/src/components/appraise/brn_appraise_bottom_picker.dart index 44f8dd24..9d6d18da 100644 --- a/lib/src/components/appraise/brn_appraise_bottom_picker.dart +++ b/lib/src/components/appraise/brn_appraise_bottom_picker.dart @@ -47,7 +47,7 @@ class BrnAppraiseBottomPicker extends StatefulWidget { Key? key, this.title = '', this.headerType = BrnAppraiseHeaderType.spaceBetween, - this.type = BrnAppraiseType.Star, + this.type = BrnAppraiseType.star, this.iconDescriptions = _defaultIconDescriptions, this.tags, this.inputHintText = '', diff --git a/lib/src/components/appraise/brn_appraise_config.dart b/lib/src/components/appraise/brn_appraise_config.dart index 866403d7..5309e308 100644 --- a/lib/src/components/appraise/brn_appraise_config.dart +++ b/lib/src/components/appraise/brn_appraise_config.dart @@ -90,8 +90,8 @@ class BrnAppraiseConfig { /// 评价组件类型 enum BrnAppraiseType { /// 表情包评价组件 - Emoji, + emoji, /// 星星评价组件 - Star, + star, } diff --git a/lib/src/components/calendar/brn_calendar_view.dart b/lib/src/components/calendar/brn_calendar_view.dart index 7fb3a339..3f5feb97 100644 --- a/lib/src/components/calendar/brn_calendar_view.dart +++ b/lib/src/components/calendar/brn_calendar_view.dart @@ -11,10 +11,10 @@ typedef CalendarDateChange = Function(DateTime date); typedef CalendarRangeDateChange = Function(DateTimeRange range); /// 展示模式,周视图模式,月视图模式 -enum DisplayMode { Week, Month } +enum DisplayMode { week, month } /// 时间选择模式,单个时间,时间范围 -enum SelectMode { SINGLE, RANGE } +enum SelectMode { single, range } const List _defaultWeekNames = ['日', '一', '二', '三', '四', '五', '六']; @@ -24,8 +24,8 @@ const List _defaultWeekNames = ['日', '一', '二', '三', '四', '五' class BrnCalendarView extends StatefulWidget { const BrnCalendarView( {Key? key, - this.selectMode = SelectMode.SINGLE, - this.displayMode = DisplayMode.Month, + this.selectMode = SelectMode.single, + this.displayMode = DisplayMode.month, this.weekNames = _defaultWeekNames, this.showControllerBar = true, this.initStartSelectedDate, @@ -37,38 +37,38 @@ class BrnCalendarView extends StatefulWidget { this.maxDate}) : assert(weekNames.length == 7), assert( - selectMode == SelectMode.SINGLE && dateChange != null || - selectMode == SelectMode.RANGE && rangeDateChange != null), + selectMode == SelectMode.single && dateChange != null || + selectMode == SelectMode.range && rangeDateChange != null), super(key: key); const BrnCalendarView.single( {Key? key, - this.displayMode = DisplayMode.Month, + this.displayMode = DisplayMode.month, this.weekNames = _defaultWeekNames, this.showControllerBar = true, this.initStartSelectedDate, this.initEndSelectedDate, this.initDisplayDate, - required CalendarDateChange this.dateChange, + required this.dateChange, this.minDate, this.maxDate}) - : this.selectMode = SelectMode.SINGLE, + : this.selectMode = SelectMode.single, this.rangeDateChange = null, assert(weekNames.length == 7), super(key: key); const BrnCalendarView.range( {Key? key, - this.displayMode = DisplayMode.Month, + this.displayMode = DisplayMode.month, this.weekNames = _defaultWeekNames, this.showControllerBar = true, this.initStartSelectedDate, this.initEndSelectedDate, this.initDisplayDate, - required CalendarRangeDateChange this.rangeDateChange, + required this.rangeDateChange, this.minDate, this.maxDate}) - : this.selectMode = SelectMode.RANGE, + : this.selectMode = SelectMode.range, this.dateChange = null, assert(weekNames.length == 7), super(key: key); @@ -132,9 +132,9 @@ class _CustomCalendarViewState extends State { _currentStartSelectedDate = widget.initStartSelectedDate; _currentEndSelectedDate = widget.initEndSelectedDate; - if (_displayMode == DisplayMode.Month) { + if (_displayMode == DisplayMode.month) { _setListOfMonthDate(_currentDate); - } else if (_displayMode == DisplayMode.Week) { + } else if (_displayMode == DisplayMode.week) { _setListOfWeekDate(_currentDate); } super.initState(); @@ -202,11 +202,11 @@ class _CustomCalendarViewState extends State { onTap: () { if (!isPreIconEnable) return; setState(() { - if (_displayMode == DisplayMode.Month) { + if (_displayMode == DisplayMode.month) { _currentDate = DateTime(_currentDate.year, _currentDate.month, 0); _setListOfMonthDate(_currentDate); - } else if (_displayMode == DisplayMode.Week) { + } else if (_displayMode == DisplayMode.week) { _currentDate = _currentDate.subtract(Duration(days: 7)); _setListOfWeekDate(_currentDate); } @@ -242,11 +242,11 @@ class _CustomCalendarViewState extends State { onTap: () { if (!isNextIconEnable) return; setState(() { - if (_displayMode == DisplayMode.Month) { + if (_displayMode == DisplayMode.month) { _currentDate = DateTime(_currentDate.year, _currentDate.month + 2, 0); _setListOfMonthDate(_currentDate); - } else if (_displayMode == DisplayMode.Week) { + } else if (_displayMode == DisplayMode.week) { _currentDate = _currentDate.add(Duration(days: 7)); _setListOfWeekDate(_currentDate); } @@ -277,7 +277,7 @@ class _CustomCalendarViewState extends State { return false; } if (dateList[0].year == _minDate.year) { - if (_displayMode == DisplayMode.Week) { + if (_displayMode == DisplayMode.week) { if (dateList[0].month < _minDate.month) { return false; } @@ -299,7 +299,7 @@ class _CustomCalendarViewState extends State { return false; } if (dateList.last.year == _maxDate.year) { - if (_displayMode == DisplayMode.Week) { + if (_displayMode == DisplayMode.week) { if (dateList.last.month > _maxDate.month) { return false; } @@ -427,12 +427,12 @@ class _CustomCalendarViewState extends State { if (date.isAfter(newMinimumDate) && date.isBefore(newMaximumDate)) { _currentDate = date; - if (_displayMode == DisplayMode.Week) { + if (_displayMode == DisplayMode.week) { _setListOfWeekDate(_currentDate); - } else if (_displayMode == DisplayMode.Month) { + } else if (_displayMode == DisplayMode.month) { _setListOfMonthDate(_currentDate); } - if (widget.selectMode == SelectMode.SINGLE) { + if (widget.selectMode == SelectMode.single) { _onSingleDateClick(date); } else { _onRangeDateClick(date); @@ -446,7 +446,7 @@ class _CustomCalendarViewState extends State { child: Text( date.day > 9 ? '${date.day}' : '0${date.day}', style: TextStyle( - color: _displayMode == DisplayMode.Month + color: _displayMode == DisplayMode.month ? (_getIsItStartAndEndDate(date) ? Colors.white : _currentDate.month == diff --git a/lib/src/components/card/content_card/brn_enhance_number_card.dart b/lib/src/components/card/content_card/brn_enhance_number_card.dart index de1624f0..1bc79a79 100644 --- a/lib/src/components/card/content_card/brn_enhance_number_card.dart +++ b/lib/src/components/card/content_card/brn_enhance_number_card.dart @@ -250,7 +250,7 @@ class BrnEnhanceNumberCard extends StatelessWidget { Widget icon = BrunoTools.getAssetSizeImage(BrnAsset.iconQuestion, 14, 14); - if (model.numberInfoIcon == BrnNumberInfoIcon.ARROW) { + if (model.numberInfoIcon == BrnNumberInfoIcon.arrow) { icon = BrunoTools.getAssetSizeImage(BrnAsset.iconRightArrow, 14, 14); } debugPrint('${tp.height}'); @@ -352,7 +352,7 @@ class BrnNumberInfoItemModel { BrnNumberInfoItemModel({ this.number, this.title, - this.numberInfoIcon = BrnNumberInfoIcon.QUESTION, + this.numberInfoIcon = BrnNumberInfoIcon.question, this.iconTapCallBack, this.preDesc, this.lastDesc, @@ -363,6 +363,6 @@ class BrnNumberInfoItemModel { ///可扩展 enum BrnNumberInfoIcon { - ARROW, - QUESTION, + arrow, + question, } diff --git a/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart b/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart index 4576437a..912efe4f 100644 --- a/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart +++ b/lib/src/components/charts/brn_progress_bar_chart/brn_progress_bar_chart_painter.dart @@ -31,13 +31,13 @@ enum BarChartStyle { //坐标轴样式 enum AxisStyle { ///无线条 - AxisStyleNone, + axisStyleNone, ///虚线 - AxisStyleDot, + axisStyleDot, ///实线 - AxisStyleSolid, + axisStyleSolid, } /// 坐标轴项目 @@ -73,7 +73,7 @@ class ChartAxis { ChartAxis({ required this.axisItemList, this.hasMark = true, - this.axisStyle = AxisStyle.AxisStyleSolid, + this.axisStyle = AxisStyle.axisStyleSolid, }); } @@ -375,12 +375,12 @@ class BrnProgressBarChartPainter extends CustomPainter { void _drawXAxisIn(Canvas canvas, Rect xAxisRect) { if (0 == this.xAxis.axisItemList.length) return; - if (AxisStyle.AxisStyleSolid == this.xAxis.axisStyle) { + if (AxisStyle.axisStyleSolid == this.xAxis.axisStyle) { Offset xLineStart = xAxisRect.topLeft; Offset xLineEnd = xAxisRect.topRight; Paint xAxisPaint = Paint()..color = Color(0xff222222); canvas.drawLine(xLineStart, xLineEnd, xAxisPaint); - } else if (AxisStyle.AxisStyleDot == this.xAxis.axisStyle) { + } else if (AxisStyle.axisStyleDot == this.xAxis.axisStyle) { Offset xLineStart = xAxisRect.topLeft; Offset xLineEnd = xAxisRect.topRight; _drawDashLineOn(canvas, xLineStart, xLineEnd, Color(0xff222222)); @@ -455,12 +455,12 @@ class BrnProgressBarChartPainter extends CustomPainter { void _drawYAxisIn(Canvas canvas, Rect yAxisRect) { if (0 == this.yAxis.axisItemList.length) return; - if (AxisStyle.AxisStyleSolid == this.yAxis.axisStyle) { + if (AxisStyle.axisStyleSolid == this.yAxis.axisStyle) { Offset yLineStart = yAxisRect.bottomRight; Offset yLineEnd = yAxisRect.topRight; Paint yAxisPaint = Paint()..color = Color(0xff222222); canvas.drawLine(yLineStart, yLineEnd, yAxisPaint); - } else if (AxisStyle.AxisStyleDot == this.xAxis.axisStyle) { + } else if (AxisStyle.axisStyleDot == this.xAxis.axisStyle) { Offset yLineStart = yAxisRect.bottomRight; Offset yLineEnd = yAxisRect.topRight; _drawDashLineOn(canvas, yLineStart, yLineEnd, Color(0xff222222)); diff --git a/lib/src/components/charts/funnel_chart.dart b/lib/src/components/charts/funnel_chart.dart index 4a70327b..a2ac4c7d 100644 --- a/lib/src/components/charts/funnel_chart.dart +++ b/lib/src/components/charts/funnel_chart.dart @@ -11,8 +11,8 @@ import 'package:flutter/rendering.dart'; /// \____文案____/ |____文案_____/ /// ___________ + ____________ /// \__文案___/ |____文案___/ -/// 第一种,是两边都向中间缩短的漏斗[FunnelShape.LeftAndRight]。 -/// 第二种,是只有一边向中间缩短的漏斗[FunnelShape.LeftOrRight]。 +/// 第一种,是两边都向中间缩短的漏斗[FunnelShape.leftAndRight]。 +/// 第二种,是只有一边向中间缩短的漏斗[FunnelShape.leftOrRight]。 /// 通过[inputTextStyle]来控制样式。 /// 在漏斗的两层layer之间或者左右可以插入标签markers,它们可以是一些常见的Widget,如[Text],在参数[children]中提供。 /// 通过[alignment]可以控制标签的插入位置。 @@ -65,7 +65,7 @@ class BrnFunnelChart extends MultiChildRenderObjectWidget { required this.markerCount, required this.layerPainter, required MarkerBuilder builder, - this.shape = FunnelShape.LeftAndRight, + this.shape = FunnelShape.leftAndRight, this.maxLayerWidth = 200, this.minLayerWidth = 0, this.layerHeight = 40, @@ -75,7 +75,7 @@ class BrnFunnelChart extends MultiChildRenderObjectWidget { }) : assert(maxLayerWidth >= minLayerWidth), assert(layerCount - markerCount == 0 || layerCount - markerCount == 1), assert(() { - if (shape == FunnelShape.LeftOrRight && + if (shape == FunnelShape.leftOrRight && alignment == MarkerAlignment.center) { debugPrint( '当shape为FunnelShape.LeftOrRight时,alignment为MarkerAlignment.center无效'); @@ -104,7 +104,7 @@ class BrnFunnelChart extends MultiChildRenderObjectWidget { this.layerMargin = 0, this.childOffset = Offset.zero, }) : this.layerPainter = BrnDefaultFunnelLayerPainter(), - this.shape = FunnelShape.LeftAndRight, + this.shape = FunnelShape.leftAndRight, this.alignment = MarkerAlignment.right, assert(layerCount <= defaultLayerColors.length && layerCount >= 0), assert(maxLayerWidth >= minLayerWidth), @@ -577,7 +577,7 @@ class BrnFunnelRender extends RenderFunnelChart { //绘制layer文案 late double safeLeft, safeTop, safeRight, safeBottom; - if (_shape == FunnelShape.LeftAndRight) { + if (_shape == FunnelShape.leftAndRight) { safeTop = i * layerHeight + i * layerMargin; if (alignment == MarkerAlignment.right) { safeLeft = ((i + 1) * layerHeight + i * layerMargin) * @@ -647,7 +647,7 @@ class BrnFunnelRender extends RenderFunnelChart { } Path path; - if (_shape == FunnelShape.LeftAndRight || + if (_shape == FunnelShape.leftAndRight || alignment == MarkerAlignment.left) { path = Path(); //这里为什么都加了HALF_PIXEL,是因为裁剪的时候边缘会留下一定像素的误差。 @@ -662,7 +662,7 @@ class BrnFunnelRender extends RenderFunnelChart { canvas.drawPath(path, _paint); } - if (_shape == FunnelShape.LeftAndRight || + if (_shape == FunnelShape.leftAndRight || alignment == MarkerAlignment.right) { path = Path(); path.moveTo(maxLayerWidth + topLeftX + HALF_PIXEL, -HALF_PIXEL); @@ -774,10 +774,10 @@ class BrnDefaultFunnelLayerPainter extends BrnFunnelLayerPainter { ///漏斗图表的形状 enum FunnelShape { ///两边从上往下都缩小 - LeftAndRight, + leftAndRight, ///一边从上往下缩小 - LeftOrRight, + leftOrRight, } ///漏斗标签的摆放位置 diff --git a/lib/src/components/dialog/brn_dialog.dart b/lib/src/components/dialog/brn_dialog.dart index c69ff23d..2bd499bc 100644 --- a/lib/src/components/dialog/brn_dialog.dart +++ b/lib/src/components/dialog/brn_dialog.dart @@ -80,16 +80,16 @@ const Divider cDividerLine = const Divider( enum ButtonType { /// 单按钮 - Single, + single, /// 多按钮 - Multi, + multi, /// 左按钮 - Left, + left, /// 右按钮 - Right, + right, } /// 对话框的样式 @@ -448,16 +448,16 @@ class BrnDialog extends AlertDialog { color: background, shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(type == ButtonType.Single || - type == ButtonType.Left || - (type == ButtonType.Multi && + bottomLeft: Radius.circular(type == ButtonType.single || + type == ButtonType.left || + (type == ButtonType.multi && actionsText != null && index == actionsText!.length - 1) ? BrnDialogUtils.getDialogRadius(dialogConfig) : 0), - bottomRight: Radius.circular(type == ButtonType.Single || - type == ButtonType.Right || - (type == ButtonType.Multi && + bottomRight: Radius.circular(type == ButtonType.single || + type == ButtonType.right || + (type == ButtonType.multi && actionsText != null && index == actionsText!.length - 1) ? BrnDialogUtils.getDialogRadius(dialogConfig) @@ -484,16 +484,16 @@ class BrnDialog extends AlertDialog { color: background, shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(type == ButtonType.Single || - type == ButtonType.Left || - (type == ButtonType.Multi && + bottomLeft: Radius.circular(type == ButtonType.single || + type == ButtonType.left || + (type == ButtonType.multi && actionsText != null && index == actionsText!.length - 1) ? BrnDialogUtils.getDialogRadius(dialogConfig) : 0), - bottomRight: Radius.circular(type == ButtonType.Single || - type == ButtonType.Right || - (type == ButtonType.Multi && + bottomRight: Radius.circular(type == ButtonType.single || + type == ButtonType.right || + (type == ButtonType.multi && actionsText != null && index == actionsText!.length - 1) ? BrnDialogUtils.getDialogRadius(dialogConfig) @@ -519,7 +519,7 @@ class BrnDialog extends AlertDialog { 0, true, defaultConfig, - type: ButtonType.Single, + type: ButtonType.single, ) : actionsWidget![0]; } else if (length == 2) { @@ -531,7 +531,7 @@ class BrnDialog extends AlertDialog { child: showTextActions ? _mapTextToGesWidget( context, actionsText![0], 0, false, defaultConfig, - type: ButtonType.Left) + type: ButtonType.left) : actionsWidget![0], ), Container( @@ -542,7 +542,7 @@ class BrnDialog extends AlertDialog { child: showTextActions ? _mapTextToGesWidget( context, actionsText![1], 1, true, defaultConfig, - type: ButtonType.Right) + type: ButtonType.right) : actionsWidget![1], ) ], @@ -558,7 +558,7 @@ class BrnDialog extends AlertDialog { return showTextActions ? _mapTextToGesWidget( context, actionsText![i], i, true, defaultConfig, - type: ButtonType.Multi) + type: ButtonType.multi) : actionsWidget![i]; }, separatorBuilder: (context, i) { @@ -571,7 +571,7 @@ class BrnDialog extends AlertDialog { Widget _mapTextToGesWidget(BuildContext context, String label, int index, bool main, BrnDialogConfig dialogConfig, - {ButtonType type = ButtonType.Single}) { + {ButtonType type = ButtonType.single}) { Text text = Text(label); Widget ges = GestureDetector( child: main diff --git a/lib/src/components/empty/brn_empty_status.dart b/lib/src/components/empty/brn_empty_status.dart index 4d364d2b..2522c917 100644 --- a/lib/src/components/empty/brn_empty_status.dart +++ b/lib/src/components/empty/brn_empty_status.dart @@ -55,13 +55,13 @@ class BrnAbnormalStateUtils { /// 操作区域按钮类型 enum OperateAreaType { /// 单按钮 - SingleButton, + singleButton, /// 双按钮 - DoubleButton, + doubleButton, /// 文本按钮 - TextButton + textButton } /// 空页面操作区域按钮的点击回调 @@ -115,7 +115,7 @@ class BrnAbnormalStateWidget extends StatelessWidget { this.img, this.title, this.content, - this.operateAreaType: OperateAreaType.TextButton, + this.operateAreaType: OperateAreaType.textButton, this.operateTexts, this.action, this.enablePageTap: false, @@ -210,7 +210,7 @@ class BrnAbnormalStateWidget extends StatelessWidget { ///操作区按钮 _buildOperateContentWidget() { - if (OperateAreaType.SingleButton == operateAreaType) { + if (OperateAreaType.singleButton == operateAreaType) { return GestureDetector( onTap: () { if (action != null) action!(0); @@ -227,7 +227,7 @@ class BrnAbnormalStateWidget extends StatelessWidget { style: themeData!.singleTextStyle.generateTextStyle()), ), ); - } else if (OperateAreaType.DoubleButton == operateAreaType) { + } else if (OperateAreaType.doubleButton == operateAreaType) { return Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -269,7 +269,7 @@ class BrnAbnormalStateWidget extends StatelessWidget { ), ], ); - } else if (OperateAreaType.TextButton == operateAreaType) { + } else if (OperateAreaType.textButton == operateAreaType) { return GestureDetector( onTap: () { if (action != null) action!(0); diff --git a/lib/src/components/form/base/brn_form_item_type.dart b/lib/src/components/form/base/brn_form_item_type.dart index 7b03723e..08e1cf60 100644 --- a/lib/src/components/form/base/brn_form_item_type.dart +++ b/lib/src/components/form/base/brn_form_item_type.dart @@ -1,61 +1,61 @@ class BrnPrefixIconType { - static const String TYPE_NORMAL = "type_normal"; - static const String TYPE_ADD = "type_add"; - static const String TYPE_REMOVE = "type_remove"; + static const String normal = "type_normal"; + static const String add = "type_add"; + static const String remove = "type_remove"; } /// 用于描述表单项的类型 class BrnInputItemType { /// appbar 类型 - static const String HEADER_NORMAL_TYPE = "header_normal_type"; + static const String headerNormalType = "header_normal_type"; /// 表单项类型 - static const String TEXT_INPUT_TYPE = "text_input_type"; - static const String TEXT_FORMAT_INPUT_TYPE = "text_format_input_type"; - static const String TEXT_ARRAY_INPUT_TYPE = "text_array_input_type"; - static const String TEXT_SELECT_INPUT_TYPE = "text_select_input_type"; - static const String TEXT_BLOCK_INPUT_TYPE = "text_block_input_type"; - static const String TEXT_INPUT_TITLE_SELECT_TYPE = + static const String textInputType = "text_input_type"; + static const String textFormatInputType = "text_format_input_type"; + static const String textArrayInputType = "text_array_input_type"; + static const String textSelectInputType = "text_select_input_type"; + static const String textBlockInputType = "text_block_input_type"; + static const String textInputTitleSelectType = "text_input_title_select_type"; - static const String TEXT_RANGE_INPUT_TYPE = "text_range_input_type"; - static const String TEXT_STEP_INPUT_TYPE = "text_step_input_type"; - static const String RADIO_INPUT_TYPE = "radio_input_type"; - static const String RADIO_PORTRAIT_INPUT_TYPE = "radio_column_input_type"; - static const String MULTI_CHOICE_INPUT_TYPE = "multi_choice_input_type"; - static const String MULTI_CHOICE_PORTRAIT_INPUT_TYPE = + static const String textRangeInputType = "text_range_input_type"; + static const String textStepInputType = "text_step_input_type"; + static const String radioInputType = "radio_input_type"; + static const String radioPortraitInputType = "radio_column_input_type"; + static const String multiChoiceInputType = "multi_choice_input_type"; + static const String multiChoicePortraitInputType = "multi_choice_column_input_type"; - static const String SWITCH_TYPE = "switch_type"; + static const String switchType = "switch_type"; - static const String STAR_INPUT_TYPE = "star_input_type"; - static const String PHOTO_PICKER_TYPE = "photo_picker_type"; - static const String EXPAND_GROUP_TYPE = "expand_group_type"; - static const String NORMAL_GROUP_TYPE = "normal_group_type"; - static const String TEXT_INPUT_RATIO_TYPE = "text_input_ratio_type"; + static const String starInputType = "star_input_type"; + static const String photoPickerType = "photo_picker_type"; + static const String expandGroupType = "expand_group_type"; + static const String normalGroupType = "normal_group_type"; + static const String textInputRatioType = "text_input_ratio_type"; - static const String TEXT_QUICK_SELECT_INPUT_TYPE = + static const String textQuickSelectInputType = "text_quick_select_input_type"; /// bottom类型 - static const String BOTTOM_BTN_TYPE = "bottom_btn_type"; + static const String bottomBtnType = "bottom_btn_type"; - static const String BTN_TYPE = "btn_type"; - static const String BTN_MULTI_TYPE = "btn_multi_type"; - static const String BTN_MULTI_STATE_TYPE = "btn_multi_state_type"; + static const String btnType = "btn_type"; + static const String btnMultiType = "btn_multi_type"; + static const String btnMultiStateType = "btn_multi_state_type"; - static const String LABEL_TITLE = "label_title"; - static const String LABEL_ADD = "label_add"; + static const String labelTitle = "label_title"; + static const String labelAdd = "label_add"; } class BrnInputType { - static const String TEXT = "text"; - static const String MULTI_LINE = "multiline"; - static const String NUMBER = "number"; - static const String DECIMAL = "decimal"; - static const String PHONE = "phone"; - static const String DATE = "datetime"; - static const String EMAIL = "emailAddress"; - static const String URL = "url"; - static const String PWD = "visiblePassword"; + static const String text = "text"; + static const String multiLine = "multiline"; + static const String number = "number"; + static const String decimal = "decimal"; + static const String phone = "phone"; + static const String date = "datetime"; + static const String email = "emailAddress"; + static const String url = "url"; + static const String pwd = "visiblePassword"; } diff --git a/lib/src/components/form/items/general/brn_multi_choice_input_item.dart b/lib/src/components/form/items/general/brn_multi_choice_input_item.dart index 48707df0..1c632b54 100644 --- a/lib/src/components/form/items/general/brn_multi_choice_input_item.dart +++ b/lib/src/components/form/items/general/brn_multi_choice_input_item.dart @@ -19,7 +19,7 @@ class BrnMultiChoiceInputFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - final String type = BrnInputItemType.MULTI_CHOICE_INPUT_TYPE; + final String type = BrnInputItemType.multiChoiceInputType; /// 录入项标题 final String title; @@ -76,7 +76,7 @@ class BrnMultiChoiceInputFormItem extends StatefulWidget { this.title = "", this.subTitle, this.tipLabel, - this.prefixIconType = BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType = BrnPrefixIconType.normal, this.error = "", this.isEdit = true, this.isRequire = true, diff --git a/lib/src/components/form/items/general/brn_multi_choice_portrait_input_item.dart b/lib/src/components/form/items/general/brn_multi_choice_portrait_input_item.dart index af1de928..8ed2e616 100644 --- a/lib/src/components/form/items/general/brn_multi_choice_portrait_input_item.dart +++ b/lib/src/components/form/items/general/brn_multi_choice_portrait_input_item.dart @@ -20,7 +20,7 @@ class BrnMultiChoicePortraitInputFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - String type = BrnInputItemType.MULTI_CHOICE_PORTRAIT_INPUT_TYPE; + String type = BrnInputItemType.multiChoicePortraitInputType; /// 录入项标题 final String title; @@ -77,7 +77,7 @@ class BrnMultiChoicePortraitInputFormItem extends StatefulWidget { this.title = "", this.subTitle = "", this.tipLabel, - this.prefixIconType = BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType = BrnPrefixIconType.normal, this.error = "", this.isEdit = true, this.isRequire = false, diff --git a/lib/src/components/form/items/general/brn_quick_select_input_item.dart b/lib/src/components/form/items/general/brn_quick_select_input_item.dart index bf8521a7..dd594699 100644 --- a/lib/src/components/form/items/general/brn_quick_select_input_item.dart +++ b/lib/src/components/form/items/general/brn_quick_select_input_item.dart @@ -22,7 +22,7 @@ class BrnTextQuickSelectFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - String type = BrnInputItemType.TEXT_QUICK_SELECT_INPUT_TYPE; + String type = BrnInputItemType.textQuickSelectInputType; /// 录入项标题 final String title; @@ -92,7 +92,7 @@ class BrnTextQuickSelectFormItem extends StatefulWidget { this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, diff --git a/lib/src/components/form/items/general/brn_radio_input_item.dart b/lib/src/components/form/items/general/brn_radio_input_item.dart index c23a99df..b13c7eba 100644 --- a/lib/src/components/form/items/general/brn_radio_input_item.dart +++ b/lib/src/components/form/items/general/brn_radio_input_item.dart @@ -24,7 +24,7 @@ class BrnRadioInputFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - final String type = BrnInputItemType.RADIO_INPUT_TYPE; + final String type = BrnInputItemType.radioInputType; /// 录入项标题 final String title; @@ -90,7 +90,7 @@ class BrnRadioInputFormItem extends StatefulWidget { this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -118,7 +118,7 @@ class BrnRadioInputFormItem extends StatefulWidget { this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, diff --git a/lib/src/components/form/items/general/brn_radio_portrait_input_item.dart b/lib/src/components/form/items/general/brn_radio_portrait_input_item.dart index d9b1473b..3a446f72 100644 --- a/lib/src/components/form/items/general/brn_radio_portrait_input_item.dart +++ b/lib/src/components/form/items/general/brn_radio_portrait_input_item.dart @@ -21,7 +21,7 @@ class BrnRadioPortraitInputFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - String type = BrnInputItemType.RADIO_INPUT_TYPE; + String type = BrnInputItemType.radioInputType; /// 录入项标题 final String title; @@ -78,7 +78,7 @@ class BrnRadioPortraitInputFormItem extends StatefulWidget { this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, diff --git a/lib/src/components/form/items/general/brn_range_input_item.dart b/lib/src/components/form/items/general/brn_range_input_item.dart index 729cb201..00d4d1ea 100644 --- a/lib/src/components/form/items/general/brn_range_input_item.dart +++ b/lib/src/components/form/items/general/brn_range_input_item.dart @@ -20,7 +20,7 @@ class BrnRangeInputFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - String type = BrnInputItemType.TEXT_RANGE_INPUT_TYPE; + String type = BrnInputItemType.textRangeInputType; /// 录入项标题 final String title; @@ -102,7 +102,7 @@ class BrnRangeInputFormItem extends StatefulWidget { this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, diff --git a/lib/src/components/form/items/general/brn_ratio_input_item.dart b/lib/src/components/form/items/general/brn_ratio_input_item.dart index effafcec..2a5c1293 100644 --- a/lib/src/components/form/items/general/brn_ratio_input_item.dart +++ b/lib/src/components/form/items/general/brn_ratio_input_item.dart @@ -20,7 +20,7 @@ class BrnRatioInputFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - String type = BrnInputItemType.TEXT_INPUT_RATIO_TYPE; + String type = BrnInputItemType.textInputRatioType; /// 录入项标题 final String title; @@ -81,7 +81,7 @@ class BrnRatioInputFormItem extends StatefulWidget { this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, diff --git a/lib/src/components/form/items/general/brn_star_input_item.dart b/lib/src/components/form/items/general/brn_star_input_item.dart index 701ba45a..b19cf5ab 100644 --- a/lib/src/components/form/items/general/brn_star_input_item.dart +++ b/lib/src/components/form/items/general/brn_star_input_item.dart @@ -22,7 +22,7 @@ class BrnStarsFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - String type = BrnInputItemType.STAR_INPUT_TYPE; + String type = BrnInputItemType.starInputType; /// 录入项标题 final String title; @@ -76,7 +76,7 @@ class BrnStarsFormItem extends StatefulWidget { this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, diff --git a/lib/src/components/form/items/general/brn_step_input_item.dart b/lib/src/components/form/items/general/brn_step_input_item.dart index 631ab199..f6c48048 100644 --- a/lib/src/components/form/items/general/brn_step_input_item.dart +++ b/lib/src/components/form/items/general/brn_step_input_item.dart @@ -21,7 +21,7 @@ class BrnStepInputFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - final String type = BrnInputItemType.TEXT_STEP_INPUT_TYPE; + final String type = BrnInputItemType.textStepInputType; /// 录入项标题 final String title; @@ -78,7 +78,7 @@ class BrnStepInputFormItem extends StatefulWidget { this.title = "", this.subTitle, this.tipLabel, - this.prefixIconType = BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType = BrnPrefixIconType.normal, this.error = "", this.isEdit = true, this.isRequire = false, diff --git a/lib/src/components/form/items/general/brn_text_block_input_item.dart b/lib/src/components/form/items/general/brn_text_block_input_item.dart index 11cff245..7fbc70b2 100644 --- a/lib/src/components/form/items/general/brn_text_block_input_item.dart +++ b/lib/src/components/form/items/general/brn_text_block_input_item.dart @@ -17,7 +17,7 @@ class BrnTextBlockInputFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - final String type = BrnInputItemType.TEXT_BLOCK_INPUT_TYPE; + final String type = BrnInputItemType.textBlockInputType; /// 录入项标题 final String title; @@ -90,7 +90,7 @@ class BrnTextBlockInputFormItem extends StatefulWidget { this.title = "", this.subTitle, this.tipLabel, - this.prefixIconType = BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType = BrnPrefixIconType.normal, this.error = "", this.isEdit = true, this.isRequire = false, diff --git a/lib/src/components/form/items/general/brn_text_input_item.dart b/lib/src/components/form/items/general/brn_text_input_item.dart index 5521af36..02058a33 100644 --- a/lib/src/components/form/items/general/brn_text_input_item.dart +++ b/lib/src/components/form/items/general/brn_text_input_item.dart @@ -18,7 +18,7 @@ class BrnTextInputFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - final String type = BrnInputItemType.TEXT_INPUT_TYPE; + final String type = BrnInputItemType.textInputType; /// 录入项标题 final String title; @@ -89,7 +89,7 @@ class BrnTextInputFormItem extends StatefulWidget { this.title = "", this.subTitle, this.tipLabel, - this.prefixIconType = BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType = BrnPrefixIconType.normal, this.error = "", this.isEdit = true, this.isRequire = false, diff --git a/lib/src/components/form/items/general/brn_text_select_item.dart b/lib/src/components/form/items/general/brn_text_select_item.dart index 2d8d3aee..1678b5c8 100644 --- a/lib/src/components/form/items/general/brn_text_select_item.dart +++ b/lib/src/components/form/items/general/brn_text_select_item.dart @@ -24,7 +24,7 @@ class BrnTextSelectFormItem extends StatefulWidget { final String? label; /// 录入项的唯一标识,主要用于录入类型页面框架中 - final String type = BrnInputItemType.TEXT_SELECT_INPUT_TYPE; + final String type = BrnInputItemType.textSelectInputType; /// 录入项类型,主要用于录入类型页面框架中 final String title; @@ -92,7 +92,7 @@ class BrnTextSelectFormItem extends StatefulWidget { this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, @@ -120,7 +120,7 @@ class BrnTextSelectFormItem extends StatefulWidget { this.title: "", this.subTitle, this.tipLabel, - this.prefixIconType: BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType: BrnPrefixIconType.normal, this.error: "", this.isEdit: true, this.isRequire: false, diff --git a/lib/src/components/form/items/general/brn_title_select_input_item.dart b/lib/src/components/form/items/general/brn_title_select_input_item.dart index fa48630e..4410cb96 100644 --- a/lib/src/components/form/items/general/brn_title_select_input_item.dart +++ b/lib/src/components/form/items/general/brn_title_select_input_item.dart @@ -24,7 +24,7 @@ class BrnTitleSelectInputFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - final String type = BrnInputItemType.TEXT_INPUT_TITLE_SELECT_TYPE; + final String type = BrnInputItemType.textInputTitleSelectType; /// 录入项标题 final String title; @@ -98,7 +98,7 @@ class BrnTitleSelectInputFormItem extends StatefulWidget { this.title = "", this.subTitle, this.tipLabel, - this.prefixIconType = BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType = BrnPrefixIconType.normal, this.error = "", this.isEdit = true, this.isRequire = false, @@ -108,7 +108,7 @@ class BrnTitleSelectInputFormItem extends StatefulWidget { this.onTip, this.hint = "请输入", this.maxCount, - this.inputType = BrnInputType.TEXT, + this.inputType = BrnInputType.text, this.selectedIndex = -1, this.inputFormatters, this.onChanged, diff --git a/lib/src/components/form/items/group/brn_expandable_group_with_opreate.dart b/lib/src/components/form/items/group/brn_expandable_group_with_opreate.dart index 8d36bf0f..13a06eab 100644 --- a/lib/src/components/form/items/group/brn_expandable_group_with_opreate.dart +++ b/lib/src/components/form/items/group/brn_expandable_group_with_opreate.dart @@ -17,7 +17,7 @@ class BrnExpandFormGroup extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - final String type = BrnInputItemType.NORMAL_GROUP_TYPE; + final String type = BrnInputItemType.normalGroupType; /// 录入项标题 final String title; diff --git a/lib/src/components/form/items/group/brn_normal_group.dart b/lib/src/components/form/items/group/brn_normal_group.dart index 8f2c1aa8..af71d4b8 100644 --- a/lib/src/components/form/items/group/brn_normal_group.dart +++ b/lib/src/components/form/items/group/brn_normal_group.dart @@ -18,7 +18,7 @@ class BrnNormalFormGroup extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - final String type = BrnInputItemType.NORMAL_GROUP_TYPE; + final String type = BrnInputItemType.normalGroupType; /// 录入项标题 final String title; diff --git a/lib/src/components/form/items/misc/brn_add_label_item.dart b/lib/src/components/form/items/misc/brn_add_label_item.dart index 55d69e7b..731c179d 100644 --- a/lib/src/components/form/items/misc/brn_add_label_item.dart +++ b/lib/src/components/form/items/misc/brn_add_label_item.dart @@ -13,7 +13,7 @@ class BrnAddLabel extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - final String type = BrnInputItemType.LABEL_ADD; + final String type = BrnInputItemType.labelAdd; /// 标题文案 final String title; diff --git a/lib/src/components/form/items/misc/brn_title_item.dart b/lib/src/components/form/items/misc/brn_title_item.dart index 0ad7d6c9..a3d77a21 100644 --- a/lib/src/components/form/items/misc/brn_title_item.dart +++ b/lib/src/components/form/items/misc/brn_title_item.dart @@ -13,7 +13,7 @@ class BrnTitleFormItem extends StatefulWidget { final String? label; /// 录入项类型,主要用于录入类型页面框架中 - final String type = BrnInputItemType.LABEL_TITLE; + final String type = BrnInputItemType.labelTitle; /// 录入项标题 final String title; @@ -58,7 +58,7 @@ class BrnTitleFormItem extends StatefulWidget { this.title = "", this.subTitle, this.tipLabel, - this.prefixIconType = BrnPrefixIconType.TYPE_NORMAL, + this.prefixIconType = BrnPrefixIconType.normal, this.error = "", this.isEdit = true, this.isRequire = false, diff --git a/lib/src/components/form/utils/brn_form_util.dart b/lib/src/components/form/utils/brn_form_util.dart index a11f269f..5ae9d8c7 100644 --- a/lib/src/components/form/utils/brn_form_util.dart +++ b/lib/src/components/form/utils/brn_form_util.dart @@ -16,7 +16,7 @@ class BrnFormUtil { static Widget buildPrefixIcon(String prefixIconType, bool isEdit, BuildContext context, VoidCallback? onAddTap, VoidCallback? onRemoveTap) { return Offstage( - offstage: prefixIconType == BrnPrefixIconType.TYPE_NORMAL, + offstage: prefixIconType == BrnPrefixIconType.normal, child: Container( padding: EdgeInsets.only(right: 6), child: GestureDetector( @@ -113,9 +113,9 @@ class BrnFormUtil { } static Widget getPrefixIcon(String type) { - if (type == BrnPrefixIconType.TYPE_ADD) { + if (type == BrnPrefixIconType.add) { return BrunoTools.getAssetImageWithBandColor(BrnAsset.iconAddFormItem); - } else if (type == BrnPrefixIconType.TYPE_REMOVE) { + } else if (type == BrnPrefixIconType.remove) { return BrunoTools.getAssetImage(BrnAsset.iconRemoveFormItem); } else { return Container(); @@ -165,7 +165,7 @@ class BrnFormUtil { /// 设置内容行padding, 包括顶部和底部padding static EdgeInsets computeEdgeInsets2(String type, bool isRequire) { - if (isRequire && type == BrnPrefixIconType.TYPE_NORMAL) { + if (isRequire && type == BrnPrefixIconType.normal) { return EdgeInsets.only(left: 10, top: 14); } @@ -187,31 +187,31 @@ class BrnFormUtil { } switch (type) { - case BrnInputType.TEXT: + case BrnInputType.text: inputType = TextInputType.text; break; - case BrnInputType.MULTI_LINE: + case BrnInputType.multiLine: inputType = TextInputType.multiline; break; - case BrnInputType.NUMBER: + case BrnInputType.number: inputType = TextInputType.number; break; - case BrnInputType.DECIMAL: + case BrnInputType.decimal: inputType = TextInputType.numberWithOptions(decimal: true); break; - case BrnInputType.PHONE: + case BrnInputType.phone: inputType = TextInputType.phone; break; - case BrnInputType.DATE: + case BrnInputType.date: inputType = TextInputType.datetime; break; - case BrnInputType.EMAIL: + case BrnInputType.email: inputType = TextInputType.emailAddress; break; - case BrnInputType.URL: + case BrnInputType.url: inputType = TextInputType.url; break; - case BrnInputType.PWD: + case BrnInputType.pwd: inputType = TextInputType.visiblePassword; break; default: @@ -228,11 +228,11 @@ class BrnFormUtil { /// 处理点击"添加/删除"按钮动作 static void notifyAddRemoveTap(BuildContext context, String prefixIconType, VoidCallback? onAddTap, VoidCallback? onRemoveTap) { - if (BrnPrefixIconType.TYPE_ADD == prefixIconType) { + if (BrnPrefixIconType.add == prefixIconType) { if (onAddTap != null) { onAddTap(); } - } else if (BrnPrefixIconType.TYPE_REMOVE == prefixIconType) { + } else if (BrnPrefixIconType.remove == prefixIconType) { if (onRemoveTap != null) { onRemoveTap(); } @@ -321,7 +321,7 @@ class BrnFormUtil { /// 标题行的左间距 static EdgeInsets titleEdgeInsets( String type, bool isRequire, BrnFormItemConfig themeData) { - if (isRequire && type == BrnPrefixIconType.TYPE_NORMAL) { + if (isRequire && type == BrnPrefixIconType.normal) { return themeData.titlePaddingSm; } return themeData.titlePaddingLg; 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 4ee900f6..b64f03df 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 @@ -2,16 +2,16 @@ import 'package:bruno/src/constants/brn_constants.dart'; import 'package:bruno/src/utils/brn_tools.dart'; enum PickerFilterType { - None, //未设置 - UnLimit, // 不限类型,与其他所有类型互斥。 - Radio, //单选列表、单选项 type为radio - Checkbox, //多选列表、多选项 type为checkbox + none, //未设置 + unLimit, // 不限类型,与其他所有类型互斥。 + radio, //单选列表、单选项 type为radio + checkbox, //多选列表、多选项 type为checkbox } /// 筛选弹窗展示风格 enum PickerWindowType { - List, //列表类型,使用列表 Item 展示。 - Range, //值范围类型,使用 Tag + Range 的 Item 展示 + list, //列表类型,使用列表 Item 展示。 + range, //值范围类型,使用 Tag + Range 的 Item 展示 } class BrnPickerEntity { @@ -100,22 +100,22 @@ class BrnPickerEntity { PickerWindowType parserShowType(String showType) { if (showType == "list") { - return PickerWindowType.List; + return PickerWindowType.list; } else if (showType == "range") { - return PickerWindowType.Range; + return PickerWindowType.range; } - return PickerWindowType.List; + return PickerWindowType.list; } PickerFilterType parserFilterTypeWithType(String? type) { if (type == "unlimit") { - return PickerFilterType.UnLimit; + return PickerFilterType.unLimit; } else if (type == "radio") { - return PickerFilterType.Radio; + return PickerFilterType.radio; } else if (type == "checkbox") { - return PickerFilterType.Checkbox; + return PickerFilterType.checkbox; } - return PickerFilterType.None; + return PickerFilterType.none; } void clearChildSelection() { @@ -236,8 +236,8 @@ class BrnPickerEntity { /// 在这里简单认为 value 为空【null 或 ''】时为 unLimit. bool isUnLimit() { - return filterType == PickerFilterType.UnLimit || - (BrunoTools.isEmpty(value) && filterType == PickerFilterType.Radio); + return filterType == PickerFilterType.unLimit || + (BrunoTools.isEmpty(value) && filterType == PickerFilterType.radio); } void clearSelectedEntity() { diff --git a/lib/src/components/picker/multi_range_picker/brn_multi_column_list.dart b/lib/src/components/picker/multi_range_picker/brn_multi_column_list.dart index 5a10b95f..1d6b7a55 100644 --- a/lib/src/components/picker/multi_range_picker/brn_multi_column_list.dart +++ b/lib/src/components/picker/multi_range_picker/brn_multi_column_list.dart @@ -131,7 +131,7 @@ class _BrnMultiColumnListWidgetState extends State { return; } - if (selectedEntity.filterType == PickerFilterType.Checkbox && + if (selectedEntity.filterType == PickerFilterType.checkbox && !selectedEntity.isSelected) { if (!BrnMultiColumnPickerUtil.isSelectedCountExceed(selectedEntity)) { BrnToast.show("您选择的数量已达上限", context); @@ -182,11 +182,11 @@ class _BrnMultiColumnListWidgetState extends State { } void _configFirstList(BrnPickerEntity selectedEntity) { - if (PickerFilterType.Radio == selectedEntity.filterType) { + if (PickerFilterType.radio == selectedEntity.filterType) { /// 单选,清除同一级别选中的状态,则其他的设置为未选中。 selectedEntity.parent!.clearChildSelection(); selectedEntity.isSelected = true; - } else if (PickerFilterType.Checkbox == selectedEntity.filterType) { + } else if (PickerFilterType.checkbox == selectedEntity.filterType) { /// 选中【不限】清除同一级别其他的状态 if (selectedEntity.isUnLimit()) { selectedEntity.parent!.clearChildSelection(); @@ -211,15 +211,15 @@ class _BrnMultiColumnListWidgetState extends State { void _configSecondList(BrnPickerEntity selectedEntity, int? currentListIndex) { if (currentListIndex == 1) { - if (PickerFilterType.Checkbox != selectedEntity.filterType) { + if (PickerFilterType.checkbox != selectedEntity.filterType) { selectedEntity.parent!.clearChildSelection(); } } else { /// 单选,清除同一级别选中的状态,则其他的设置为未选中。 - if (PickerFilterType.Radio == selectedEntity.filterType) { + if (PickerFilterType.radio == selectedEntity.filterType) { selectedEntity.parent!.clearChildSelection(); selectedEntity.isSelected = true; - } else if (PickerFilterType.Checkbox == selectedEntity.filterType) { + } else if (PickerFilterType.checkbox == selectedEntity.filterType) { /// 选中【不限】清除同一级别其他的状态 if (selectedEntity.isUnLimit()) { selectedEntity.parent!.clearChildSelection(); @@ -245,15 +245,15 @@ class _BrnMultiColumnListWidgetState extends State { void _configThirdList(BrnPickerEntity selectedEntity, int? currentListIndex) { if (currentListIndex == 1) { - if (PickerFilterType.Checkbox != selectedEntity.filterType) { + if (PickerFilterType.checkbox != selectedEntity.filterType) { selectedEntity.parent!.clearChildSelection(); } } else { /// 单选,清除同一级别选中的状态,则其他的设置为未选中。 - if (PickerFilterType.Radio == selectedEntity.filterType) { + if (PickerFilterType.radio == selectedEntity.filterType) { selectedEntity.parent!.clearChildSelection(); selectedEntity.isSelected = true; - } else if (PickerFilterType.Checkbox == selectedEntity.filterType) { + } else if (PickerFilterType.checkbox == selectedEntity.filterType) { /// 选中【不限】清除同一级别其他的状态 if (selectedEntity.isUnLimit()) { selectedEntity.parent!.clearChildSelection(); diff --git a/lib/src/components/picker/multi_range_picker/brn_multi_column_picker.dart b/lib/src/components/picker/multi_range_picker/brn_multi_column_picker.dart index 80667415..e070c441 100644 --- a/lib/src/components/picker/multi_range_picker/brn_multi_column_picker.dart +++ b/lib/src/components/picker/multi_range_picker/brn_multi_column_picker.dart @@ -180,7 +180,7 @@ class _BrnSelectionGroupViewState extends State { (int listIndex, int index, BrnPickerEntity entity) { _setFirstIndex(index); if (_columnCount == 1 && - widget.entity.filterType == PickerFilterType.Radio) { + widget.entity.filterType == PickerFilterType.radio) { _confirmButtonClickEvent(); } if (widget.onEntityTap != null) { @@ -472,7 +472,7 @@ class _BrnSelectionGroupViewState extends State { // 例如1级为多选,不应该默认选中2级的不限 // 否则每选中任意一个1级选项,就默认有了一个2级的不限 if (entity.isUnLimit() && - entity.parent!.filterType != PickerFilterType.Checkbox) { + entity.parent!.filterType != PickerFilterType.checkbox) { index = levelList.indexOf(entity); break; } diff --git a/lib/src/components/picker/multi_range_picker/btn_multi_column_picker_item.dart b/lib/src/components/picker/multi_range_picker/btn_multi_column_picker_item.dart index e745625b..55dbb9be 100644 --- a/lib/src/components/picker/multi_range_picker/btn_multi_column_picker_item.dart +++ b/lib/src/components/picker/multi_range_picker/btn_multi_column_picker_item.dart @@ -137,7 +137,7 @@ class BrnMultiRangePickerCommonItem extends StatelessWidget { int? count; if (item.parent != null) { count = item.parent!.children - .where((f) => f.filterType == PickerFilterType.Checkbox) + .where((f) => f.filterType == PickerFilterType.checkbox) .length; } return count == null ? false : count > 0; diff --git a/lib/src/components/picker/time_picker/date_picker/brn_date_widget.dart b/lib/src/components/picker/time_picker/date_picker/brn_date_widget.dart index b7f6622a..1d0b2a9f 100755 --- a/lib/src/components/picker/time_picker/date_picker/brn_date_widget.dart +++ b/lib/src/components/picker/time_picker/date_picker/brn_date_widget.dart @@ -11,7 +11,7 @@ import 'package:bruno/src/theme/brn_theme.dart'; import 'package:bruno/src/utils/i18n/brn_date_picker_i18n.dart'; import 'package:flutter/material.dart'; -enum ColumnType { Year, Month, Day } +enum ColumnType { year, month, day } /// Solar months of 31 days. const List _solarMonthsOf31Days = const [1, 3, 5, 7, 8, 10, 12]; @@ -233,8 +233,8 @@ class _BrnDateWidgetState extends State { childCount: valueRange.last - valueRange.first + 1, itemBuilder: (context, index) => _renderDatePickerItemComponent( format.contains("y") - ? ColumnType.Year - : (format.contains("M") ? ColumnType.Month : ColumnType.Day), + ? ColumnType.year + : (format.contains("M") ? ColumnType.month : ColumnType.day), index, valueRange.first + index, format), @@ -246,10 +246,10 @@ class _BrnDateWidgetState extends State { Widget _renderDatePickerItemComponent( ColumnType columnType, int index, int value, String format) { TextStyle textStyle = widget.themeData!.itemTextStyle.generateTextStyle(); - if ((ColumnType.Year == columnType && index == _calcSelectIndexList()[0]) || - (ColumnType.Month == columnType && + if ((ColumnType.year == columnType && index == _calcSelectIndexList()[0]) || + (ColumnType.month == columnType && index == _calcSelectIndexList()[1]) || - (ColumnType.Day == columnType && index == _calcSelectIndexList()[2])) { + (ColumnType.day == columnType && index == _calcSelectIndexList()[2])) { textStyle = widget.themeData!.itemTextSelectedStyle.generateTextStyle(); } return Container( diff --git a/lib/src/components/picker/time_picker/date_picker/brn_datetime_widget.dart b/lib/src/components/picker/time_picker/date_picker/brn_datetime_widget.dart index 010a35dd..b0f33a65 100755 --- a/lib/src/components/picker/time_picker/date_picker/brn_datetime_widget.dart +++ b/lib/src/components/picker/time_picker/date_picker/brn_datetime_widget.dart @@ -11,7 +11,7 @@ import 'package:bruno/src/theme/brn_theme.dart'; import 'package:bruno/src/utils/i18n/brn_date_picker_i18n.dart'; import 'package:flutter/material.dart'; -enum ColumnType { Year, Month, Day, Hour, Minute, Second } +enum ColumnType { year, month, day, hour, minute, second } /// DateTimePicker widget. Can display date and time picker // ignore: must_be_immutable @@ -365,17 +365,17 @@ class _BrnDateTimeWidgetState extends State { // ignore: missing_return ColumnType? getColumnType(String format) { if (format.contains('y')) { - return ColumnType.Year; + return ColumnType.year; } else if (format.contains('M')) { - return ColumnType.Month; + return ColumnType.month; } else if (format.contains('d')) { - return ColumnType.Day; + return ColumnType.day; } else if (format.contains('H')) { - return ColumnType.Hour; + return ColumnType.hour; } else if (format.contains('m')) { - return ColumnType.Minute; + return ColumnType.minute; } else if (format.contains('s')) { - return ColumnType.Second; + return ColumnType.second; } return null; } @@ -467,14 +467,14 @@ class _BrnDateTimeWidgetState extends State { Widget _renderDatePickerItemComponent( ColumnType? columnType, int index, int value, String format) { TextStyle textStyle = widget.themeData!.itemTextStyle.generateTextStyle(); - if ((ColumnType.Year == columnType && index == _calcSelectIndexList()[0]) || - (ColumnType.Month == columnType && + if ((ColumnType.year == columnType && index == _calcSelectIndexList()[0]) || + (ColumnType.month == columnType && index == _calcSelectIndexList()[1]) || - (ColumnType.Day == columnType && index == _calcSelectIndexList()[2]) || - (ColumnType.Hour == columnType && index == _calcSelectIndexList()[3]) || - (ColumnType.Minute == columnType && + (ColumnType.day == columnType && index == _calcSelectIndexList()[2]) || + (ColumnType.hour == columnType && index == _calcSelectIndexList()[3]) || + (ColumnType.minute == columnType && index == _calcSelectIndexList()[4]) || - (ColumnType.Second == columnType && + (ColumnType.second == columnType && index == _calcSelectIndexList()[5])) { textStyle = widget.themeData!.itemTextSelectedStyle.generateTextStyle(); } diff --git a/lib/src/components/picker/time_picker/date_picker/brn_time_widget.dart b/lib/src/components/picker/time_picker/date_picker/brn_time_widget.dart index 314b6312..1e9e0491 100755 --- a/lib/src/components/picker/time_picker/date_picker/brn_time_widget.dart +++ b/lib/src/components/picker/time_picker/date_picker/brn_time_widget.dart @@ -13,7 +13,7 @@ import 'package:flutter/material.dart'; /// TimePicker widget. -enum ColumnType { Hour, Minute, Second } +enum ColumnType { hour, minute, second } // ignore: must_be_immutable class BrnTimeWidget extends StatefulWidget { @@ -269,11 +269,11 @@ class _BrnTimeWidgetState extends State { // ignore: missing_return ColumnType? getColumnType(String format) { if (format.contains('H')) { - return ColumnType.Hour; + return ColumnType.hour; } else if (format.contains('m')) { - return ColumnType.Minute; + return ColumnType.minute; } else if (format.contains('s')) { - return ColumnType.Second; + return ColumnType.second; } return null; } @@ -290,10 +290,10 @@ class _BrnTimeWidgetState extends State { Widget _renderDatePickerItemComponent( ColumnType? columnType, int index, int value, String format) { TextStyle textStyle = widget.themeData!.itemTextStyle.generateTextStyle(); - if ((ColumnType.Hour == columnType && index == _calcSelectIndexList()[0]) || - (ColumnType.Minute == columnType && + if ((ColumnType.hour == columnType && index == _calcSelectIndexList()[0]) || + (ColumnType.minute == columnType && index == _calcSelectIndexList()[1]) || - (ColumnType.Second == columnType && + (ColumnType.second == columnType && index == _calcSelectIndexList()[2])) { textStyle = widget.themeData!.itemTextSelectedStyle.generateTextStyle(); } diff --git a/lib/src/components/picker/time_picker/date_range_picker/brn_date_range_side_widget.dart b/lib/src/components/picker/time_picker/date_range_picker/brn_date_range_side_widget.dart index 97a46047..fb3a4afb 100755 --- a/lib/src/components/picker/time_picker/date_range_picker/brn_date_range_side_widget.dart +++ b/lib/src/components/picker/time_picker/date_range_picker/brn_date_range_side_widget.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; /// Solar months of 31 days. const List _solarMonthsOf31Days = const [1, 3, 5, 7, 8, 10, 12]; -enum ColumnType { Year, Month, Day } +enum ColumnType { year, month, day } /// one side widget of DateRangePicker // ignore: must_be_immutable @@ -237,8 +237,8 @@ class _DatePickerWidgetState extends State { childCount: valueRange.last - valueRange.first + 1, itemBuilder: (context, index) => _renderDatePickerItemComponent( format.contains("y") - ? ColumnType.Year - : (format.contains("M") ? ColumnType.Month : ColumnType.Day), + ? ColumnType.year + : (format.contains("M") ? ColumnType.month : ColumnType.day), index, valueRange.first + index, format), @@ -250,10 +250,10 @@ class _DatePickerWidgetState extends State { Widget _renderDatePickerItemComponent( ColumnType columnType, int index, int value, String format) { TextStyle textStyle = widget.themeData!.itemTextStyle.generateTextStyle(); - if ((ColumnType.Year == columnType && index == _calcSelectIndexList()[0]) || - (ColumnType.Month == columnType && + if ((ColumnType.year == columnType && index == _calcSelectIndexList()[0]) || + (ColumnType.month == columnType && index == _calcSelectIndexList()[1]) || - (ColumnType.Day == columnType && index == _calcSelectIndexList()[2])) { + (ColumnType.day == columnType && index == _calcSelectIndexList()[2])) { textStyle = widget.themeData!.itemTextSelectedStyle.generateTextStyle(); } return Container( diff --git a/lib/src/components/selection/bean/brn_selection_common_entity.dart b/lib/src/components/selection/bean/brn_selection_common_entity.dart index 79472cd7..c4c04c94 100644 --- a/lib/src/components/selection/bean/brn_selection_common_entity.dart +++ b/lib/src/components/selection/bean/brn_selection_common_entity.dart @@ -5,49 +5,49 @@ import 'package:bruno/src/utils/brn_tools.dart'; enum BrnSelectionFilterType { /// 未设置 - None, + none, /// 不限类型 - UnLimit, + unLimit, /// 单选列表、单选项 type 为 radio - Radio, + radio, /// 多选列表、多选项 type 为 checkbox - Checkbox, + checkbox, /// 一般的值范围自定义区间 type 为 range - Range, + range, /// 日期选择,普通筛选时使用 CalendarView 展示选择时间,更多情况下使用 DatePicker 选择时间 - Date, + date, /// 自定义选择日期区间, type 为 dateRange - DateRange, + dateRange, /// 自定义通过 Calendar 选择日期区间,type 为 dateRangeCalendar - DateRangeCalendar, + dateRangeCalendar, /// 标签筛选 type 为 customerTag - CustomHandle, + customHandle, /// 更多列表、多选项 无 type - More, + more, /// 去二级页面 - Layer, + layer, /// 去自定义二级页面 - CustomLayer, + customLayer, } /// 筛选弹窗展示风格 enum BrnSelectionWindowType { /// 列表类型,使用列表 Item 展示 - List, + list, /// 值范围类型,使用 Tag + Range 的 Item 展示 - Range, + range, } class BrnSelectionEntity { @@ -225,9 +225,9 @@ class BrnSelectionEntity { /// 当 default 不在普通 Item 类型中时,尝试填充 同级别 Range Item. if (children.where((_) => _.isSelected).toList().length == 0) { List rangeItems = this.children.where((_) { - return (_.filterType == BrnSelectionFilterType.Range || - _.filterType == BrnSelectionFilterType.DateRange || - _.filterType == BrnSelectionFilterType.DateRangeCalendar); + return (_.filterType == BrnSelectionFilterType.range || + _.filterType == BrnSelectionFilterType.dateRange || + _.filterType == BrnSelectionFilterType.dateRangeCalendar); }).toList(); BrnSelectionEntity? rangeEntity; if (rangeItems.isNotEmpty) { @@ -258,50 +258,50 @@ class BrnSelectionEntity { BrnSelectionWindowType parserShowType(String? showType) { if (showType == "list") { - return BrnSelectionWindowType.List; + return BrnSelectionWindowType.list; } else if (showType == "range") { - return BrnSelectionWindowType.Range; + return BrnSelectionWindowType.range; } - return BrnSelectionWindowType.List; + return BrnSelectionWindowType.list; } BrnSelectionFilterType parserFilterTypeWithType(String? type) { if (type == 'unlimit') { - return BrnSelectionFilterType.UnLimit; + return BrnSelectionFilterType.unLimit; } else if (type == "radio") { - return BrnSelectionFilterType.Radio; + return BrnSelectionFilterType.radio; } else if (type == "checkbox") { - return BrnSelectionFilterType.Checkbox; + return BrnSelectionFilterType.checkbox; } else if (type == "range") { - return BrnSelectionFilterType.Range; + return BrnSelectionFilterType.range; } else if (type == "customHandle") { - return BrnSelectionFilterType.CustomHandle; + return BrnSelectionFilterType.customHandle; } else if (type == "more") { - return BrnSelectionFilterType.More; + return BrnSelectionFilterType.more; } else if (type == 'floatinglayer') { - return BrnSelectionFilterType.Layer; + return BrnSelectionFilterType.layer; } else if (type == 'customfloatinglayer') { - return BrnSelectionFilterType.CustomLayer; + return BrnSelectionFilterType.customLayer; } else if (type == 'date') { - return BrnSelectionFilterType.Date; + return BrnSelectionFilterType.date; } else if (type == 'daterange') { - return BrnSelectionFilterType.DateRange; + return BrnSelectionFilterType.dateRange; } else if (type == 'daterangecalendar') { - return BrnSelectionFilterType.DateRangeCalendar; + return BrnSelectionFilterType.dateRangeCalendar; } - return BrnSelectionFilterType.None; + return BrnSelectionFilterType.none; } void clearChildSelection() { if (children.length > 0) { for (BrnSelectionEntity entity in children) { entity.isSelected = false; - if (entity.filterType == BrnSelectionFilterType.Date) { + if (entity.filterType == BrnSelectionFilterType.date) { entity.value = null; } - if (entity.filterType == BrnSelectionFilterType.Range || - entity.filterType == BrnSelectionFilterType.DateRange || - entity.filterType == BrnSelectionFilterType.DateRangeCalendar) { + if (entity.filterType == BrnSelectionFilterType.range || + entity.filterType == BrnSelectionFilterType.dateRange || + entity.filterType == BrnSelectionFilterType.dateRangeCalendar) { entity.customMap = Map(); } entity.clearChildSelection(); @@ -344,21 +344,21 @@ class BrnSelectionEntity { return selected .where((_) => !_.isUnLimit()) .where((_) => - (_.filterType != BrnSelectionFilterType.Range) || - (_.filterType == BrnSelectionFilterType.Range && !BrunoTools.isEmpty(_.customMap))) + (_.filterType != BrnSelectionFilterType.range) || + (_.filterType == BrnSelectionFilterType.range && !BrunoTools.isEmpty(_.customMap))) .where((_) => - (_.filterType != BrnSelectionFilterType.DateRange) || - (_.filterType == BrnSelectionFilterType.DateRange && + (_.filterType != BrnSelectionFilterType.dateRange) || + (_.filterType == BrnSelectionFilterType.dateRange && !BrunoTools.isEmpty(_.customMap))) .where((_) => - (_.filterType != BrnSelectionFilterType.DateRangeCalendar) || - (_.filterType == BrnSelectionFilterType.DateRangeCalendar && + (_.filterType != BrnSelectionFilterType.dateRangeCalendar) || + (_.filterType == BrnSelectionFilterType.dateRangeCalendar && !BrunoTools.isEmpty(_.customMap))) .toList(); } List selectedList() { - if (BrnSelectionFilterType.More == this.filterType) { + if (BrnSelectionFilterType.more == this.filterType) { return this.selectedLastColumnList(); } else { List results = []; @@ -461,13 +461,13 @@ class BrnSelectionEntity { /// 检查自己的兄弟结点是否存在 checkbox 类型。 bool hasCheckBoxBrother() { int? count = - parent?.children.where((f) => f.filterType == BrnSelectionFilterType.Checkbox).length; + parent?.children.where((f) => f.filterType == BrnSelectionFilterType.checkbox).length; return count == null ? false : count > 0; } /// 在这里简单认为 value 为空【null 或 ''】时为 unlimit. bool isUnLimit() { - return filterType == BrnSelectionFilterType.UnLimit; + return filterType == BrnSelectionFilterType.unLimit; } void clearSelectedEntity() { @@ -486,9 +486,9 @@ class BrnSelectionEntity { List currentTagListForEntity() { List list = []; children.forEach((data) { - if (data.filterType != BrnSelectionFilterType.Range && - data.filterType != BrnSelectionFilterType.DateRange && - data.filterType != BrnSelectionFilterType.DateRangeCalendar) { + if (data.filterType != BrnSelectionFilterType.range && + data.filterType != BrnSelectionFilterType.dateRange && + data.filterType != BrnSelectionFilterType.dateRangeCalendar) { list.add(data); } }); @@ -524,9 +524,9 @@ class BrnSelectionEntity { List currentRangeListForEntity() { List list = []; children.forEach((data) { - if (data.filterType == BrnSelectionFilterType.Range || - data.filterType == BrnSelectionFilterType.DateRange || - data.filterType == BrnSelectionFilterType.DateRangeCalendar) { + if (data.filterType == BrnSelectionFilterType.range || + data.filterType == BrnSelectionFilterType.dateRange || + data.filterType == BrnSelectionFilterType.dateRangeCalendar) { list.add(data); } }); @@ -534,20 +534,20 @@ class BrnSelectionEntity { } bool isValidRange() { - if (this.filterType == BrnSelectionFilterType.Range || - this.filterType == BrnSelectionFilterType.DateRange || - this.filterType == BrnSelectionFilterType.DateRangeCalendar) { + if (this.filterType == BrnSelectionFilterType.range || + this.filterType == BrnSelectionFilterType.dateRange || + this.filterType == BrnSelectionFilterType.dateRangeCalendar) { DateTime minTime = DateTime.parse(datePickerMinDatetime); DateTime maxTime = DateTime.parse(datePickerMaxDatetime); int limitMin = int.tryParse(extMap['min']?.toString() ?? "") ?? - (this.filterType == BrnSelectionFilterType.DateRange || - this.filterType == BrnSelectionFilterType.DateRangeCalendar + (this.filterType == BrnSelectionFilterType.dateRange || + this.filterType == BrnSelectionFilterType.dateRangeCalendar ? minTime.millisecondsSinceEpoch : 0); // 日期最大值没设置 默认是2121年01月01日 08:00:00 int limitMax = int.tryParse(extMap['max']?.toString() ?? "") ?? - (this.filterType == BrnSelectionFilterType.DateRange || - this.filterType == BrnSelectionFilterType.DateRangeCalendar + (this.filterType == BrnSelectionFilterType.dateRange || + this.filterType == BrnSelectionFilterType.dateRangeCalendar ? maxTime.millisecondsSinceEpoch : 9999); diff --git a/lib/src/components/selection/brn_flat_selection.dart b/lib/src/components/selection/brn_flat_selection.dart index 57ceee95..e581dde6 100644 --- a/lib/src/components/selection/brn_flat_selection.dart +++ b/lib/src/components/selection/brn_flat_selection.dart @@ -26,7 +26,7 @@ class BrnFlatSelection extends StatefulWidget { /// 每行展示tag数量 默认真是3个 final int preLineTagSize; - /// 当[BrnSelectionEntity.filterType]为[BrnSelectionFilterType.Layer] or[BrnSelectionFilterType.CustomLayer]时 + /// 当[BrnSelectionEntity.filterType]为[BrnSelectionFilterType.layer] or[BrnSelectionFilterType.customLayer]时 /// 跳转到二级页面的自定义操作 final BrnOnCustomFloatingLayerClick? onCustomFloatingLayerClick; @@ -227,7 +227,7 @@ class _BrnFlatSelectionState extends State with SingleTickerPr void _clearUIData(BrnSelectionEntity entity) { entity.isSelected = false; entity.customMap = Map(); - if (BrnSelectionFilterType.Range == entity.filterType) { + if (BrnSelectionFilterType.range == entity.filterType) { entity.title = ''; } for (BrnSelectionEntity subEntity in entity.children) { diff --git a/lib/src/components/selection/brn_more_selection.dart b/lib/src/components/selection/brn_more_selection.dart index 7d5e200e..95d90c72 100644 --- a/lib/src/components/selection/brn_more_selection.dart +++ b/lib/src/components/selection/brn_more_selection.dart @@ -221,7 +221,7 @@ class _BrnMoreSelectionPageState extends State void _clearUIData(BrnSelectionEntity entity) { entity.isSelected = false; entity.customMap = Map(); - if (BrnSelectionFilterType.Range == entity.filterType) { + if (BrnSelectionFilterType.range == entity.filterType) { entity.title = ''; } for (BrnSelectionEntity subEntity in entity.children) { @@ -240,18 +240,18 @@ class _BrnMoreSelectionPageState extends State while (tmp.isNotEmpty) { node = tmp.removeLast(); if (node.isSelected && - (node.filterType == BrnSelectionFilterType.Range || - node.filterType == BrnSelectionFilterType.DateRange || - node.filterType == BrnSelectionFilterType.DateRangeCalendar)) { + (node.filterType == BrnSelectionFilterType.range || + node.filterType == BrnSelectionFilterType.dateRange || + node.filterType == BrnSelectionFilterType.dateRangeCalendar)) { if (node.customMap != null && (BrunoTools.isEmpty(node.customMap!['min']) || BrunoTools.isEmpty(node.customMap!['max']))) { if (!node.isValidRange()) { isValid = false; - if (node.filterType == BrnSelectionFilterType.Range) { + if (node.filterType == BrnSelectionFilterType.range) { BrnToast.show('您输入的区间有误', context); - } else if (node.filterType == BrnSelectionFilterType.DateRange || - node.filterType == BrnSelectionFilterType.DateRangeCalendar) { + } else if (node.filterType == BrnSelectionFilterType.dateRange || + node.filterType == BrnSelectionFilterType.dateRangeCalendar) { BrnToast.show('您选择的区间有误', context); } return; diff --git a/lib/src/components/selection/brn_selection_util.dart b/lib/src/components/selection/brn_selection_util.dart index f4111222..69b488d8 100644 --- a/lib/src/components/selection/brn_selection_util.dart +++ b/lib/src/components/selection/brn_selection_util.dart @@ -9,17 +9,17 @@ class BrnSelectionUtil { /// 处理兄弟结点为未选中状态,将自己置为选中状态 static void processBrotherItemSelectStatus( BrnSelectionEntity selectionEntity) { - if (BrnSelectionFilterType.Checkbox == selectionEntity.filterType) { + if (BrnSelectionFilterType.checkbox == selectionEntity.filterType) { selectionEntity.isSelected = !selectionEntity.isSelected; List? allBrothers = selectionEntity.parent?.children; if (!BrunoTools.isEmpty(allBrothers)) { for (BrnSelectionEntity entity in allBrothers!) { if (entity != selectionEntity) { - if (entity.filterType == BrnSelectionFilterType.Radio) { + if (entity.filterType == BrnSelectionFilterType.radio) { entity.isSelected = false; } - if (entity.filterType == BrnSelectionFilterType.Date) { + if (entity.filterType == BrnSelectionFilterType.date) { entity.isSelected = false; entity.value = null; } @@ -27,12 +27,12 @@ class BrnSelectionUtil { } } } - if (BrnSelectionFilterType.Radio == selectionEntity.filterType) { + if (BrnSelectionFilterType.radio == selectionEntity.filterType) { selectionEntity.parent?.clearChildSelection(); selectionEntity.isSelected = true; } - if (BrnSelectionFilterType.Date == selectionEntity.filterType) { + if (BrnSelectionFilterType.date == selectionEntity.filterType) { selectionEntity.parent?.clearChildSelection(); /// 日期类型时在外部 Picker 点击确定时设置 选中状态 @@ -81,10 +81,10 @@ class BrnSelectionUtil { /// 判断列表中是否有range类型 static bool hasRangeItem(List list) { for (BrnSelectionEntity entity in list) { - if (BrnSelectionFilterType.Range == entity.filterType || - BrnSelectionFilterType.DateRange == entity.filterType || - BrnSelectionFilterType.DateRangeCalendar == entity.filterType || - BrnSelectionWindowType.Range == entity.filterShowType) { + if (BrnSelectionFilterType.range == entity.filterType || + BrnSelectionFilterType.dateRange == entity.filterType || + BrnSelectionFilterType.dateRangeCalendar == entity.filterType || + BrnSelectionWindowType.range == entity.filterShowType) { return true; } } @@ -97,9 +97,9 @@ class BrnSelectionUtil { BrnSelectionEntity? filledCustomInputItem; for (BrnSelectionEntity entity in list) { if (entity.isSelected && - (BrnSelectionFilterType.Range == entity.filterType || - BrnSelectionFilterType.DateRange == entity.filterType || - BrnSelectionFilterType.DateRangeCalendar == entity.filterType) && + (BrnSelectionFilterType.range == entity.filterType || + BrnSelectionFilterType.dateRange == entity.filterType || + BrnSelectionFilterType.dateRangeCalendar == entity.filterType) && entity.customMap != null) { filledCustomInputItem = entity; break; diff --git a/lib/src/components/selection/brn_selection_view.dart b/lib/src/components/selection/brn_selection_view.dart index dfecf3b6..6ee37f02 100644 --- a/lib/src/components/selection/brn_selection_view.dart +++ b/lib/src/components/selection/brn_selection_view.dart @@ -168,7 +168,7 @@ class BrnSelectionViewState extends State { /// 2、触发更新 UI。 /// 3、触发 _onSelectionChanged 统一回调给外部 if (widget.originalSelectionData[menuIndex].filterType == - BrnSelectionFilterType.CustomHandle && + BrnSelectionFilterType.customHandle && widget.onCustomSelectionMenuClick != null) { widget.onCustomSelectionMenuClick!(menuIndex, widget.originalSelectionData[menuIndex], (Map customParams) { @@ -182,7 +182,7 @@ class BrnSelectionViewState extends State { } /// 自定义 Menu 的时候,让外部设置选中的 value 进来统一更新 UI。 然后触发 _onSelectionChanged 统一回调给外部 - if (widget.originalSelectionData[menuIndex].filterType == BrnSelectionFilterType.More && + if (widget.originalSelectionData[menuIndex].filterType == BrnSelectionFilterType.more && widget.onMoreSelectionMenuClick != null) { widget.onMoreSelectionMenuClick!(menuIndex, ( {bool updateData = false, List? moreSelections}) { diff --git a/lib/src/components/selection/converter/brn_selection_converter.dart b/lib/src/components/selection/converter/brn_selection_converter.dart index da4f9d74..f9b3ce12 100644 --- a/lib/src/components/selection/converter/brn_selection_converter.dart +++ b/lib/src/components/selection/converter/brn_selection_converter.dart @@ -46,7 +46,7 @@ Map getSelectionParams(List? selectedResults Map params = Map(); if (selectedResults == null) return params; for (BrnSelectionEntity menuItemEntity in selectedResults) { - if (menuItemEntity.filterType == BrnSelectionFilterType.More) { + if (menuItemEntity.filterType == BrnSelectionFilterType.more) { params.addAll(getSelectionParams(menuItemEntity.children)); } else { /// 1、首先找出 自定义范围的筛选项参数。 diff --git a/lib/src/components/selection/widget/brn_flat_selection_item.dart b/lib/src/components/selection/widget/brn_flat_selection_item.dart index 70d3d4ac..3f8ffc80 100644 --- a/lib/src/components/selection/widget/brn_flat_selection_item.dart +++ b/lib/src/components/selection/widget/brn_flat_selection_item.dart @@ -28,7 +28,7 @@ class BrnFlatMoreSelection extends StatefulWidget { /// 清空已选项 一般跟重置功能搭配使用 final StreamController? clearController; - /// 当[BrnSelectionEntity.filterType]为[BrnSelectionFilterType.Layer] or[BrnSelectionFilterType.CustomLayer]时 + /// 当[BrnSelectionEntity.filterType]为[BrnSelectionFilterType.layer] or[BrnSelectionFilterType.customLayer]时 /// 跳转到二级页面的自定义操作 final BrnOnCustomFloatingLayerClick? onCustomFloatingLayerClick; @@ -60,8 +60,8 @@ class _BrnFlatMoreSelectionState extends State { @override Widget build(BuildContext context) { //弹出浮层 - if (widget.selectionEntity.filterType == BrnSelectionFilterType.Layer || - widget.selectionEntity.filterType == BrnSelectionFilterType.CustomLayer) { + if (widget.selectionEntity.filterType == BrnSelectionFilterType.layer || + widget.selectionEntity.filterType == BrnSelectionFilterType.customLayer) { return FilterLayerTypeWidget( selectionEntity: widget.selectionEntity, onCustomFloatingLayerClick: widget.onCustomFloatingLayerClick, @@ -239,12 +239,12 @@ class __FilterCommonTypeWidgetState extends State<_FilterCommonTypeWidget> { return GestureDetector( onTap: () { setState(() { - if (data.filterType == BrnSelectionFilterType.Radio) { + if (data.filterType == BrnSelectionFilterType.radio) { data.parent?.clearSelectedEntity(); data.isSelected = true; //用于发送 标签点击事件 _streamController.add(SelectEvent()); - } else if (data.filterType == BrnSelectionFilterType.Checkbox) { + } else if (data.filterType == BrnSelectionFilterType.checkbox) { if (!data.isSelected) { if (!BrnSelectionUtil.checkMaxSelectionCount(data)) { BrnToast.show('您选择的筛选条件数量已达上限', context); @@ -253,12 +253,12 @@ class __FilterCommonTypeWidgetState extends State<_FilterCommonTypeWidget> { } data.parent?.children - .where((_) => _.filterType == BrnSelectionFilterType.Radio) + .where((_) => _.filterType == BrnSelectionFilterType.radio) .forEach((f) => f.isSelected = false); data.isSelected = !data.isSelected; //用于发送 标签点击事件 _streamController.add(SelectEvent()); - } else if (data.filterType == BrnSelectionFilterType.Date) { + } else if (data.filterType == BrnSelectionFilterType.date) { _showDatePicker(data); } }); @@ -289,7 +289,7 @@ class __FilterCommonTypeWidgetState extends State<_FilterCommonTypeWidget> { } Widget _buildSingleTag(BrnSelectionEntity data) { - bool isDate = data.filterType == BrnSelectionFilterType.Date; + bool isDate = data.filterType == BrnSelectionFilterType.date; String showName; @@ -627,7 +627,7 @@ class _FilterLayerTypeWidgetState extends State { padding: const EdgeInsets.only(left: 20, right: 20, top: 6), child: GestureDetector( onTap: () { - if (widget.selectionEntity.filterType == BrnSelectionFilterType.Layer) { + if (widget.selectionEntity.filterType == BrnSelectionFilterType.layer) { Navigator.of(context) .push(PageRouteBuilder( opaque: false, @@ -640,7 +640,7 @@ class _FilterLayerTypeWidgetState extends State { .then((data) { updateContent(); }); - } else if (widget.selectionEntity.filterType == BrnSelectionFilterType.CustomLayer) { + } else if (widget.selectionEntity.filterType == BrnSelectionFilterType.customLayer) { if (widget.onCustomFloatingLayerClick != null) { int entityIndex = -1; if (widget.selectionEntity.parent != null && diff --git a/lib/src/components/selection/widget/brn_layer_more_selection_page.dart b/lib/src/components/selection/widget/brn_layer_more_selection_page.dart index 68ff1b2a..f345c1cb 100644 --- a/lib/src/components/selection/widget/brn_layer_more_selection_page.dart +++ b/lib/src/components/selection/widget/brn_layer_more_selection_page.dart @@ -201,7 +201,7 @@ class _BrnLayerMoreSelectionPageState extends State if (index == _currentIndex) { return; } - if (_firstList[index].filterType == BrnSelectionFilterType.Radio) { + if (_firstList[index].filterType == BrnSelectionFilterType.radio) { setState(() { _currentIndex = index; _currentFirstEntity = _firstList[index]; @@ -217,7 +217,7 @@ class _BrnLayerMoreSelectionPageState extends State }); } else { _firstList[index].parent?.children.where((data) { - return data.filterType != BrnSelectionFilterType.Checkbox; + return data.filterType != BrnSelectionFilterType.checkbox; }).forEach((data) { data.isSelected = false; data.clearChildSelection(); @@ -336,8 +336,8 @@ class _BrnLayerMoreSelectionPageState extends State Widget _buildRightItem(int index) { bool isSingle = - (_currentFirstEntity?.children[index].filterType == BrnSelectionFilterType.Radio) || - (_currentFirstEntity?.children[index].filterType == BrnSelectionFilterType.UnLimit); + (_currentFirstEntity?.children[index].filterType == BrnSelectionFilterType.radio) || + (_currentFirstEntity?.children[index].filterType == BrnSelectionFilterType.unLimit); return GestureDetector( onTap: () { @@ -349,7 +349,7 @@ class _BrnLayerMoreSelectionPageState extends State _currentFirstEntity!.children[index].isSelected = true; } else { _currentFirstEntity!.children.where((data) { - return data.filterType != BrnSelectionFilterType.Checkbox; + return data.filterType != BrnSelectionFilterType.checkbox; }).forEach((data) { data.isSelected = false; }); @@ -461,7 +461,7 @@ class _BrnLayerMoreSelectionPageState extends State if (secondIndex == -1 && currentFirstEntity.children.isNotEmpty) { for (int i = 0, n = currentFirstEntity.children.length; i < n; i++) { if (currentFirstEntity.children[i].isUnLimit() && - currentFirstEntity.filterType == BrnSelectionFilterType.Checkbox) { + currentFirstEntity.filterType == BrnSelectionFilterType.checkbox) { currentFirstEntity.children[i].isSelected = true; break; } diff --git a/lib/src/components/selection/widget/brn_selection_list_widget.dart b/lib/src/components/selection/widget/brn_selection_list_widget.dart index 1815a41b..2a716df4 100644 --- a/lib/src/components/selection/widget/brn_selection_list_widget.dart +++ b/lib/src/components/selection/widget/brn_selection_list_widget.dart @@ -92,7 +92,7 @@ class _BrnSelectionGroupViewState extends State { widgetList.add(_listWidget()); // TODO 判断是否添加 Bottom - if (totalLevel == 1 && widget.entity.filterType == BrnSelectionFilterType.Radio) { + if (totalLevel == 1 && widget.entity.filterType == BrnSelectionFilterType.radio) { } else { widgetList.add(_bottomWidget()); } @@ -117,7 +117,7 @@ class _BrnSelectionGroupViewState extends State { focusedIndex: _firstIndex, singleListItemSelect: (int listIndex, int index, BrnSelectionEntity entity) { _setFirstIndex(index); - if (totalLevel == 1 && widget.entity.filterType == BrnSelectionFilterType.Radio) { + if (totalLevel == 1 && widget.entity.filterType == BrnSelectionFilterType.radio) { _confirmButtonClickEvent(); } })); @@ -372,7 +372,7 @@ class _BrnSelectionGroupViewState extends State { void _resetSelectionData(BrnSelectionEntity entity) { entity.isSelected = false; entity.customMap = Map(); - if (BrnSelectionFilterType.Range == entity.filterType) { + if (BrnSelectionFilterType.range == entity.filterType) { entity.title = ''; } for (BrnSelectionEntity subEntity in entity.children) { diff --git a/lib/src/components/selection/widget/brn_selection_menu_widget.dart b/lib/src/components/selection/widget/brn_selection_menu_widget.dart index 01686e9b..b7a9d332 100644 --- a/lib/src/components/selection/widget/brn_selection_menu_widget.dart +++ b/lib/src/components/selection/widget/brn_selection_menu_widget.dart @@ -211,15 +211,15 @@ class _BrnSelectionMenuWidgetState extends State { listViewController.hide(); } else { /// 点击不是 More、自定义类型,则直接展开。 - if (widget.data[index].filterType != BrnSelectionFilterType.More && - widget.data[index].filterType != BrnSelectionFilterType.CustomHandle) { + if (widget.data[index].filterType != BrnSelectionFilterType.more && + widget.data[index].filterType != BrnSelectionFilterType.customHandle) { /// 创建 筛选组件的的入口 OverlayEntry entry = _createEntry(widget.data[index]); Overlay.of(widget.context)?.insert(entry); listViewController.entry = entry; listViewController.show(index); - } else if (widget.data[index].filterType == BrnSelectionFilterType.CustomHandle) { + } else if (widget.data[index].filterType == BrnSelectionFilterType.customHandle) { /// 记录自定义筛选 menu 的点击状态,当点击自定义的 menu 时,menu 文案默认高亮。 listViewController.show(index); _refreshSelectionMenuTitle(index, widget.data[index]); @@ -257,11 +257,11 @@ class _BrnSelectionMenuWidgetState extends State { /// 3、只有一列筛选数据,且为多选时,使用 Tag 模式展示 bool _isRange(BrnSelectionEntity entity) { if (BrnSelectionUtil.hasRangeItem(entity.children) || - entity.filterShowType == BrnSelectionWindowType.Range) { + entity.filterShowType == BrnSelectionWindowType.range) { return true; } var totalLevel = BrnSelectionUtil.getTotalLevel(entity); - if (totalLevel == 1 && entity.filterType == BrnSelectionFilterType.Checkbox) { + if (totalLevel == 1 && entity.filterType == BrnSelectionFilterType.checkbox) { return true; } return false; @@ -339,7 +339,7 @@ class _BrnSelectionMenuWidgetState extends State { /// 筛选 Title 展示规则 String? _getSelectedResultTitle(BrnSelectionEntity entity) { /// 更多筛选不改变 title.故返回 null - if (entity.filterType == BrnSelectionFilterType.More) { + if (entity.filterType == BrnSelectionFilterType.more) { return null; } if (BrunoTools.isEmpty(entity.customTitle)) { @@ -371,10 +371,10 @@ class _BrnSelectionMenuWidgetState extends State { /// 第一列选中了一个,为【不限】类型,使用上一级别的名字展示。 if (firstColumn[0].isUnLimit()) { title = entity.title; - } else if (firstColumn[0].filterType == BrnSelectionFilterType.Range || - firstColumn[0].filterType == BrnSelectionFilterType.Date || - firstColumn[0].filterType == BrnSelectionFilterType.DateRange || - firstColumn[0].filterType == BrnSelectionFilterType.DateRangeCalendar) { + } else if (firstColumn[0].filterType == BrnSelectionFilterType.range || + firstColumn[0].filterType == BrnSelectionFilterType.date || + firstColumn[0].filterType == BrnSelectionFilterType.dateRange || + firstColumn[0].filterType == BrnSelectionFilterType.dateRangeCalendar) { title = _getDateAndRangeTitle(firstColumn, entity); } else { if (secondColumn.length == 0 || secondColumn.length > 1) { @@ -383,10 +383,10 @@ class _BrnSelectionMenuWidgetState extends State { /// 第二列选中了一个,为【不限】类型,使用上一级别的名字展示。 if (secondColumn[0].isUnLimit()) { title = firstColumn[0].title; - } else if (secondColumn[0].filterType == BrnSelectionFilterType.Range || - secondColumn[0].filterType == BrnSelectionFilterType.Date || - secondColumn[0].filterType == BrnSelectionFilterType.DateRange || - secondColumn[0].filterType == BrnSelectionFilterType.DateRangeCalendar) { + } else if (secondColumn[0].filterType == BrnSelectionFilterType.range || + secondColumn[0].filterType == BrnSelectionFilterType.date || + secondColumn[0].filterType == BrnSelectionFilterType.dateRange || + secondColumn[0].filterType == BrnSelectionFilterType.dateRangeCalendar) { title = _getDateAndRangeTitle(secondColumn, firstColumn[0]); } else { if (thirdColumn.length == 0 || thirdColumn.length > 1) { @@ -395,10 +395,10 @@ class _BrnSelectionMenuWidgetState extends State { /// 第三列选中了一个,为【不限】类型,使用上一级别的名字展示。 if (thirdColumn[0].isUnLimit()) { title = secondColumn[0].title; - } else if (thirdColumn[0].filterType == BrnSelectionFilterType.Range || - thirdColumn[0].filterType == BrnSelectionFilterType.Date || - thirdColumn[0].filterType == BrnSelectionFilterType.DateRange || - thirdColumn[0].filterType == BrnSelectionFilterType.DateRangeCalendar) { + } else if (thirdColumn[0].filterType == BrnSelectionFilterType.range || + thirdColumn[0].filterType == BrnSelectionFilterType.date || + thirdColumn[0].filterType == BrnSelectionFilterType.dateRange || + thirdColumn[0].filterType == BrnSelectionFilterType.dateRangeCalendar) { title = _getDateAndRangeTitle(thirdColumn, secondColumn[0]); } else { title = thirdColumn[0].title; @@ -416,15 +416,15 @@ class _BrnSelectionMenuWidgetState extends State { String? _getDateAndRangeTitle(List list, BrnSelectionEntity entity) { String? title = ''; if (!BrunoTools.isEmpty(list[0].customMap)) { - if (list[0].filterType == BrnSelectionFilterType.Range) { + if (list[0].filterType == BrnSelectionFilterType.range) { title = '${list[0].customMap!['min']}-${list[0].customMap!['max']}(${list[0].extMap['unit']?.toString()})'; - } else if (list[0].filterType == BrnSelectionFilterType.DateRange || - list[0].filterType == BrnSelectionFilterType.DateRangeCalendar) { + } else if (list[0].filterType == BrnSelectionFilterType.dateRange || + list[0].filterType == BrnSelectionFilterType.dateRangeCalendar) { title = _getDateRangeTitle(list); } } else { - if (list[0].filterType == BrnSelectionFilterType.Date) { + if (list[0].filterType == BrnSelectionFilterType.date) { title = _getDateTimeTitle(list); } else { title = entity.title; @@ -486,7 +486,7 @@ class _BrnSelectionMenuWidgetState extends State { } void _refreshSelectionMenuTitle(int index, BrnSelectionEntity entity) { - if (entity.filterType == BrnSelectionFilterType.More) { + if (entity.filterType == BrnSelectionFilterType.more) { if (entity.allSelectedList().length > 0) { menuItemHighlightState[index] = true; } else { diff --git a/lib/src/components/selection/widget/brn_selection_more_item_widget.dart b/lib/src/components/selection/widget/brn_selection_more_item_widget.dart index 3d8ce56c..528b7d36 100644 --- a/lib/src/components/selection/widget/brn_selection_more_item_widget.dart +++ b/lib/src/components/selection/widget/brn_selection_more_item_widget.dart @@ -48,8 +48,8 @@ class _BrnMoreSelectionWidgetState extends State { @override Widget build(BuildContext context) { //弹出浮层 - if (widget.selectionEntity.filterType == BrnSelectionFilterType.Layer || - widget.selectionEntity.filterType == BrnSelectionFilterType.CustomLayer) { + if (widget.selectionEntity.filterType == BrnSelectionFilterType.layer || + widget.selectionEntity.filterType == BrnSelectionFilterType.customLayer) { return FilterLayerTypeWidget( selectionEntity: widget.selectionEntity, onCustomFloatingLayerClick: widget.onCustomFloatingLayerClick, @@ -217,12 +217,12 @@ class __FilterCommonTypeWidgetState extends State<_FilterCommonTypeWidget> { return GestureDetector( onTap: () { setState(() { - if (data.filterType == BrnSelectionFilterType.Radio) { + if (data.filterType == BrnSelectionFilterType.radio) { data.parent?.clearSelectedEntity(); data.isSelected = true; //用于发送 标签点击事件 streamController.add(SelectEvent()); - } else if (data.filterType == BrnSelectionFilterType.Checkbox) { + } else if (data.filterType == BrnSelectionFilterType.checkbox) { if (!data.isSelected) { if (!BrnSelectionUtil.checkMaxSelectionCount(data)) { BrnToast.show('您选择的筛选条件数量已达上限', context); @@ -231,12 +231,12 @@ class __FilterCommonTypeWidgetState extends State<_FilterCommonTypeWidget> { } data.parent?.children - .where((_) => _.filterType == BrnSelectionFilterType.Radio) + .where((_) => _.filterType == BrnSelectionFilterType.radio) .forEach((f) => f.isSelected = false); data.isSelected = !data.isSelected; //用于发送 标签点击事件 streamController.add(SelectEvent()); - } else if (data.filterType == BrnSelectionFilterType.Date) { + } else if (data.filterType == BrnSelectionFilterType.date) { _showDatePicker(data); } }); @@ -248,7 +248,7 @@ class __FilterCommonTypeWidgetState extends State<_FilterCommonTypeWidget> { } Widget _buildSingleTag(BrnSelectionEntity entity) { - bool isDate = entity.filterType == BrnSelectionFilterType.Date; + bool isDate = entity.filterType == BrnSelectionFilterType.date; String? showName; @@ -431,7 +431,7 @@ class __MoreRangeWidgetState extends State<_MoreRangeWidget> { /// 1:将输入框的 文本写入 customMap中 /// 2:如果最大值和最小值满足条件 则将range选中 minController.addListener(() { - if (widget.rangeEntity.filterType != BrnSelectionFilterType.Range) { + if (widget.rangeEntity.filterType != BrnSelectionFilterType.range) { return; } String minInput = minController.text; @@ -446,7 +446,7 @@ class __MoreRangeWidgetState extends State<_MoreRangeWidget> { }); maxController.addListener(() { - if (widget.rangeEntity.filterType != BrnSelectionFilterType.Range) { + if (widget.rangeEntity.filterType != BrnSelectionFilterType.range) { return; } String maxInput = maxController.text; @@ -490,7 +490,7 @@ class __MoreRangeWidgetState extends State<_MoreRangeWidget> { @override Widget build(BuildContext context) { - if (widget.rangeEntity.filterType == BrnSelectionFilterType.DateRange) { + if (widget.rangeEntity.filterType == BrnSelectionFilterType.dateRange) { return BrnSelectionDateRangeItemWidget( item: widget.rangeEntity, isNeedTitle: false, @@ -594,7 +594,7 @@ class _FilterLayerTypeWidgetState extends State { padding: const EdgeInsets.only(left: 20, right: 20, top: 6), child: GestureDetector( onTap: () { - if (widget.selectionEntity.filterType == BrnSelectionFilterType.Layer) { + if (widget.selectionEntity.filterType == BrnSelectionFilterType.layer) { Navigator.of(context) .push(PageRouteBuilder( opaque: false, @@ -607,7 +607,7 @@ class _FilterLayerTypeWidgetState extends State { .then((data) { setState(() {}); }); - } else if (widget.selectionEntity.filterType == BrnSelectionFilterType.CustomLayer) { + } else if (widget.selectionEntity.filterType == BrnSelectionFilterType.customLayer) { if (widget.onCustomFloatingLayerClick != null) { int entityIndex = -1; if (widget.selectionEntity.parent != null) { diff --git a/lib/src/components/selection/widget/brn_selection_range_tag_widget.dart b/lib/src/components/selection/widget/brn_selection_range_tag_widget.dart index 192ac8c6..52ee7fd3 100644 --- a/lib/src/components/selection/widget/brn_selection_range_tag_widget.dart +++ b/lib/src/components/selection/widget/brn_selection_range_tag_widget.dart @@ -63,7 +63,7 @@ class _BrnSelectionRangeTagWidgetState extends State child: tagWidget, onTap: () { var selectedEntity = widget.tagFilterList[nameIndex]; - if (BrnSelectionFilterType.Checkbox == selectedEntity.filterType && + if (BrnSelectionFilterType.checkbox == selectedEntity.filterType && !selectedEntity.isSelected) { if (!BrnSelectionUtil.checkMaxSelectionCount(selectedEntity)) { BrnToast.show("您选择的筛选条件数量已达上限", context); @@ -85,7 +85,7 @@ class _BrnSelectionRangeTagWidgetState extends State bool selected = widget.tagFilterList[nameIndex].isSelected || nameIndex == widget.initFocusedIndex; String text = widget.tagFilterList[nameIndex].title; - if (widget.tagFilterList[nameIndex].filterType == BrnSelectionFilterType.Date && + if (widget.tagFilterList[nameIndex].filterType == BrnSelectionFilterType.date && !BrunoTools.isEmpty(widget.tagFilterList[nameIndex].value)) { if (int.tryParse(widget.tagFilterList[nameIndex].value ?? '') != null) { DateTime? dateTime = diff --git a/lib/src/components/selection/widget/brn_selection_range_widget.dart b/lib/src/components/selection/widget/brn_selection_range_widget.dart index 75b2e44d..a4ef0536 100644 --- a/lib/src/components/selection/widget/brn_selection_range_widget.dart +++ b/lib/src/components/selection/widget/brn_selection_range_widget.dart @@ -197,10 +197,10 @@ class _BrnRangeSelectionGroupWidgetState extends State tagFilterList = subFilterList .where((f) => - f.filterType != BrnSelectionFilterType.Range && - f.filterType != BrnSelectionFilterType.Date && - f.filterType != BrnSelectionFilterType.DateRange && - f.filterType != BrnSelectionFilterType.DateRangeCalendar) + f.filterType != BrnSelectionFilterType.range && + f.filterType != BrnSelectionFilterType.date && + f.filterType != BrnSelectionFilterType.dateRange && + f.filterType != BrnSelectionFilterType.dateRangeCalendar) .toList(); Size maxWidthSize = Size.zero; for (BrnSelectionEntity entity in subFilterList) { @@ -258,7 +258,7 @@ class _BrnRangeSelectionGroupWidgetState extends State subFilterList) { subFilterList .where((f) => - f.filterType == BrnSelectionFilterType.Range || - f.filterType == BrnSelectionFilterType.Date || - f.filterType == BrnSelectionFilterType.DateRange || - f.filterType == BrnSelectionFilterType.DateRangeCalendar) + f.filterType == BrnSelectionFilterType.range || + f.filterType == BrnSelectionFilterType.date || + f.filterType == BrnSelectionFilterType.dateRange || + f.filterType == BrnSelectionFilterType.dateRangeCalendar) .forEach((f) { f.isSelected = false; f.customMap = Map(); @@ -544,10 +544,10 @@ class _BrnRangeSelectionGroupWidgetState extends State subFilterList) { subFilterList - .where((f) => f.filterType != BrnSelectionFilterType.Range) - .where((f) => f.filterType != BrnSelectionFilterType.Date) - .where((f) => f.filterType != BrnSelectionFilterType.DateRange) - .where((f) => f.filterType != BrnSelectionFilterType.DateRangeCalendar) + .where((f) => f.filterType != BrnSelectionFilterType.range) + .where((f) => f.filterType != BrnSelectionFilterType.date) + .where((f) => f.filterType != BrnSelectionFilterType.dateRange) + .where((f) => f.filterType != BrnSelectionFilterType.dateRangeCalendar) .forEach((f) { f.isSelected = false; f.customMap = Map(); @@ -558,9 +558,9 @@ class _BrnRangeSelectionGroupWidgetState extends State filterList) { List ranges = filterList .where((f) => - (f.filterType == BrnSelectionFilterType.Range || - f.filterType == BrnSelectionFilterType.DateRange || - f.filterType == BrnSelectionFilterType.DateRangeCalendar) && + (f.filterType == BrnSelectionFilterType.range || + f.filterType == BrnSelectionFilterType.dateRange || + f.filterType == BrnSelectionFilterType.dateRangeCalendar) && f.isSelected) .toList(); @@ -594,9 +594,9 @@ class _BrnRangeSelectionGroupWidgetState extends State subFilterList) { bool isCustomInputSelected = false; for (BrnSelectionEntity entity in subFilterList) { - if (BrnSelectionFilterType.Range == entity.filterType || - BrnSelectionFilterType.DateRange == entity.filterType || - BrnSelectionFilterType.DateRangeCalendar == entity.filterType) { + if (BrnSelectionFilterType.range == entity.filterType || + BrnSelectionFilterType.dateRange == entity.filterType || + BrnSelectionFilterType.dateRangeCalendar == entity.filterType) { isCustomInputSelected = entity.isSelected; break; } @@ -604,9 +604,9 @@ class _BrnRangeSelectionGroupWidgetState extends State - f.filterType != BrnSelectionFilterType.Range && - f.filterType != BrnSelectionFilterType.DateRange && - f.filterType != BrnSelectionFilterType.DateRangeCalendar && + f.filterType != BrnSelectionFilterType.range && + f.filterType != BrnSelectionFilterType.dateRange && + f.filterType != BrnSelectionFilterType.dateRangeCalendar && f.isSelected) .toList(); if (!isCustomInputSelected && BrunoTools.isEmpty(selectedItem)) { @@ -624,8 +624,8 @@ class _BrnRangeSelectionGroupWidgetState extends State - _.filterType == BrnSelectionFilterType.Date || - _.filterType == BrnSelectionFilterType.DateRangeCalendar) + _.filterType == BrnSelectionFilterType.date || + _.filterType == BrnSelectionFilterType.dateRangeCalendar) .toList() .length > 0; @@ -634,8 +634,8 @@ class _BrnRangeSelectionGroupWidgetState extends State - _.filterType == BrnSelectionFilterType.Date || - _.filterType == BrnSelectionFilterType.DateRangeCalendar) + _.filterType == BrnSelectionFilterType.date || + _.filterType == BrnSelectionFilterType.dateRangeCalendar) .toList() .length; if (count > 0) { diff --git a/lib/src/components/selection/widget/brn_selection_single_list_widget.dart b/lib/src/components/selection/widget/brn_selection_single_list_widget.dart index 41d3ca8c..e578d08a 100644 --- a/lib/src/components/selection/widget/brn_selection_single_list_widget.dart +++ b/lib/src/components/selection/widget/brn_selection_single_list_widget.dart @@ -35,10 +35,10 @@ class BrnSelectionSingleListWidget extends StatefulWidget { }) : super(key: key) { items = items .where((_) => - _.filterType != BrnSelectionFilterType.Range && - _.filterType != BrnSelectionFilterType.Date && - _.filterType != BrnSelectionFilterType.DateRange && - _.filterType != BrnSelectionFilterType.DateRangeCalendar) + _.filterType != BrnSelectionFilterType.range && + _.filterType != BrnSelectionFilterType.date && + _.filterType != BrnSelectionFilterType.dateRange && + _.filterType != BrnSelectionFilterType.dateRangeCalendar) .toList(); /// 当前 Items 所在的层级 @@ -81,8 +81,8 @@ class _BrnSelectionSingleListWidgetState extends State f.isSelected).length ?? 0) > 0) { @@ -163,11 +163,11 @@ class _BrnSelectionSingleListWidgetState extends State f != selectedEntity).forEach((f) { f.clearChildSelection(); f.isSelected = false; }); selectedEntity.isSelected = true; - } else if (BrnSelectionFilterType.Checkbox == selectedEntity.filterType) { + } else if (BrnSelectionFilterType.checkbox == selectedEntity.filterType) { /// 选中【不限】清除同一级别其他的状态 if (selectedEntity.isUnLimit()) { selectedEntity.parent?.children.where((f) => f != selectedEntity).forEach((f) { diff --git a/lib/src/theme/base/brn_base_config.dart b/lib/src/theme/base/brn_base_config.dart index ebbcf3a7..ccb9ad60 100644 --- a/lib/src/theme/base/brn_base_config.dart +++ b/lib/src/theme/base/brn_base_config.dart @@ -1,5 +1,4 @@ import 'package:bruno/src/theme/brn_theme_configurator.dart'; -import 'package:bruno/src/theme/base/brn_default_config_utils.dart'; import 'package:bruno/src/theme/configs/brn_common_config.dart'; /// 组件配置基类