CustomDateRange class
A widget for selecting custom date ranges with preset options.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CustomDateRange
Constructors
-
CustomDateRange({Key? key, dynamic onDateRangeChanged(DateTime startDate, DateTime endDate)?, required bool showAllMonths, DateTimeRange<
DateTime> ? initialDateTimeRange, Color? primaryColor, Color? unselectedTextColor, TextStyle? dateTextStyle, TextStyle? labelTextStyle, TextStyle? errorTextStyle, String? fontFamily, int? maxRangeMonths, int? maxRangeYears, void onValidationError(BuildContext context, String message)?}) -
const
Properties
- dateTextStyle → TextStyle?
-
Text style for date field labels and values. If null, uses Theme.of(context).textTheme.bodyLarge.
final
- errorTextStyle → TextStyle?
-
Text style for error messages. If null, uses Theme.of(context).textTheme.bodyMedium with red color.
final
- fontFamily → String?
-
Global font family that applies across all text. This will be merged into all TextStyles if provided.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
initialDateTimeRange
→ DateTimeRange<
DateTime> ? -
Initial date range to display.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- labelTextStyle → TextStyle?
-
Text style for info/label text. If null, uses Theme.of(context).textTheme.bodyMedium.
final
- maxRangeMonths → int?
-
Maximum allowed range in months. If null and maxRangeYears is also null, no limit is applied.
If maxRangeYears is provided, this parameter is ignored.
final
- maxRangeYears → int?
-
Maximum allowed range in years. If provided, takes precedence over maxRangeMonths.
For example, 1 year = 12 months, 2 years = 24 months.
If both maxRangeYears and maxRangeMonths are null, no limit is applied.
final
- onDateRangeChanged → dynamic Function(DateTime startDate, DateTime endDate)?
-
Callback when date range changes.
final
- onValidationError → void Function(BuildContext context, String message)?
-
Callback for showing validation errors. If null, uses a default inline error display.
final
- primaryColor → Color?
-
Primary color for selected items. If null, uses Theme.of(context).colorScheme.primary.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showAllMonths → bool
-
Whether to show all months regardless of restrictions.
final
- unselectedTextColor → Color?
-
Color for unselected text. If null, uses Theme.of(context).textTheme.bodyMedium?.color with opacity.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CustomDateRange> -
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