JunnyFormWeekParams class
周选择字段参数配置类
继承自 JunnyFormSelectionParams,添加了周选择特有的配置项。 通过 JunnyFormTimeFormatMixin 提供格式化配置字段。
注意:WeekField 使用特殊的周格式化逻辑("X月第Y周"),不支持自定义 displayFormat。
dataFormat 默认为 yyyy-MM-dd HH:mm:ss。
示例:
extraParams: JunnyFormWeekParams(
week: 'weekNumber',
dataFormat: DatePattern.yMdHms.toFormat(),
startingDayOfWeek: DateTime.monday,
startTime: DateTime(2020),
endTime: DateTime(2025),
shouldInterceptSelect: () => false,
).toMap();
- Inheritance
-
- Object
- JunnyFormSelectionParams<
String> - JunnyFormWeekParams
- Mixed-in types
Constructors
-
JunnyFormWeekParams({required String week, DateFormat? displayFormat, DateFormat? dataFormat, int startingDayOfWeek = DateTime.monday, DateTime? startTime, DateTime? endTime, bool enableFormatCache = false, FutureOr<
bool> shouldInterceptSelect()?, bool? maintainVirtualFocusDuringSelect}) - 创建一个周选择参数配置实例
Properties
- dataFormat → DateFormat?
-
周数据保存格式
默认为 yyyy-MM-dd HH:mm:ss
final
- displayFormat → DateFormat?
-
周显示格式
注意:WeekField 使用特殊的周格式化逻辑("X月第Y周"),此字段通常不生效
final
- enableFormatCache → bool
-
是否启用格式化缓存(字段级控制)
final
- endTime → DateTime?
-
可选择的结束时间
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- maintainVirtualFocusDuringSelect → bool?
-
选择过程是否保持虚拟焦点
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shouldInterceptSelect
→ FutureOr<
bool> Function()? -
选择操作拦截器(点击选择前)
finalinherited
- startingDayOfWeek → int
-
一周的起始日
默认为 DateTime.monday
可选值范围为 DateTime.monday 到 DateTime.sunday
final
- startTime → DateTime?
-
可选择的起始时间
final
- week → String
-
周数字段的key,必需
final
Methods
-
copyWith(
{String? week, DateFormat? displayFormat, DateFormat? dataFormat, int? startingDayOfWeek, DateTime? startTime, DateTime? endTime, bool? enableFormatCache, FutureOr< bool> shouldInterceptSelect()?, bool? maintainVirtualFocusDuringSelect}) → JunnyFormWeekParams -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
timeFormatToMap(
) → Map< String, dynamic> -
将格式化配置转换为 Map
inherited
-
toMap(
) → Map< String, dynamic> -
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
fromMap(
Map< String, dynamic> map) → JunnyFormWeekParams -
从 Map 创建参数实例
override