NZCalendar class

NZCalendar 是 NezhaUI 提供的专业日历组件。

它支持多样式切换、农历显示、平滑动画以及高度自定义的主题配置。 适用于日程管理、日期选择等场景。

Inheritance

Constructors

NZCalendar({Key? key, DateTime? initialDate, DateTime? firstDate, DateTime? lastDate, ValueChanged<DateTime>? onDateSelected, bool showHeader = true, bool showLunar = true, NZCalendarStyle style = NZCalendarStyle.classic, Color? primaryColor, Color? backgroundColor, double borderRadius = 16.0, bool usePrompt = false, List<String>? promptOptions, void onOptionSelected(DateTime date, String option)?, Map<DateTime, List<Color>>? events, List<String> weekDayLabels = const ['日', '一', '二', '三', '四', '五', '六']})
const

Properties

backgroundColor Color?
背景颜色
final
borderRadius double
容器圆角
final
events Map<DateTime, List<Color>>?
事件标记 (日期 -> 颜色列表)
final
firstDate DateTime?
最小可选日期
final
hashCode int
The hash code for this object.
no setterinherited
initialDate DateTime?
初始选中的日期,默认为今天
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lastDate DateTime?
最大可选日期
final
onDateSelected ValueChanged<DateTime>?
日期选中回调
final
onOptionSelected → void Function(DateTime date, String option)?
选项选中回调
final
primaryColor Color?
自定义主色调
final
promptOptions List<String>?
弹窗选项列表
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showHeader bool
是否显示头部导航
final
showLunar bool
是否显示农历
final
style NZCalendarStyle
样式类型
final
usePrompt bool
是否开启点击弹窗选项
final
weekDayLabels List<String>
星期显示文本
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<NZCalendar>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited