PagedVerticalCalendar class
a minimalistic paginated calendar widget providing infinite customisation options and usefull paginated callbacks. all paremeters are optional.
PagedVerticalCalendar(
startDate: DateTime(2021, 1, 1),
endDate: DateTime(2021, 12, 31),
onDayPressed: (day) {
print('Date selected: $day');
},
onMonthLoaded: (year, month) {
print('month loaded: $month-$year');
},
onPaginationCompleted: () {
print('end reached');
},
),
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PagedVerticalCalendar
Constructors
-
PagedVerticalCalendar({DateTime? minDate, DateTime? maxDate, DateTime? initialDate, MonthBuilder? monthBuilder, DayBuilder? dayBuilder, bool addAutomaticKeepAlives = false, ValueChanged<
DateTime> ? onDayPressed, OnMonthLoaded? onMonthLoaded, ValueChanged<PaginationDirection> ? onPaginationCompleted, int invisibleMonthsThreshold = 1, ScrollPhysics? physics, ScrollController? scrollController, EdgeInsets listPadding = EdgeInsets.zero, bool startWeekWithSunday = false, List<int> weekdaysToHide = const [], bool reverse = false, double dayAspectRatio = 1, Key? key})
Properties
- addAutomaticKeepAlives → bool
-
if the calendar should stay cached when the widget is no longer loaded.
this can be used for maintaining the last state. defaults to
falsefinal - dayAspectRatio → double
-
Each dayBuilder aspect ratio
final
- dayBuilder → DayBuilder?
-
a Builder used for day generation. a default DayBuilder is
used when no custom DayBuilder is provided.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialDate → DateTime
-
the initial date displayed by the calendar.
if inititial date is nulll, the start date will be used
final
- invisibleMonthsThreshold → int
-
how many months should be loaded outside of the view. defaults to
1final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- listPadding → EdgeInsets
-
list padding, defaults to
0final - maxDate → DateTime?
-
optional DateTime to end the calendar pagination, of no
endDateis provided the calendar can paginate indefinitelyfinal - minDate → DateTime?
-
the DateTime to start the calendar from, if no
startDateis providedDateTime.now()will be usedfinal - monthBuilder → MonthBuilder?
-
a Builder used for month header generation. a default MonthBuilder is
used when no custom MonthBuilder is provided.
final
-
onDayPressed
→ ValueChanged<
DateTime> ? -
callback that provides the DateTime of the day that's been interacted
with
final
- onMonthLoaded → OnMonthLoaded?
-
callback when a new paginated month is loaded.
final
-
onPaginationCompleted
→ ValueChanged<
PaginationDirection> ? -
called when the calendar pagination is completed. if no minDate or maxDate is
provided this method is never called for that direction
final
- physics → ScrollPhysics?
-
scroll physics, defaults to matching platform conventions
final
- reverse → bool
-
Whether the calendar scrolls in the reading direction.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
scroll controller for making programmable scroll interactions
final
- startWeekWithSunday → bool
-
Select start day of the week to be Sunday
final
-
weekdaysToHide
→ List<
int> -
Hide certain Weekdays eg.Weekends by providing
[DateTime.sunday,DateTime.monday]. By default all weekdays are shownfinal
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PagedVerticalCalendar> -
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