LiteDatePicker class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LiteDatePicker
Constructors
-
LiteDatePicker.new({Key? key, required String name, LiteFormValueSerializer serializer = nonConvertingValueConvertor, LiteFormValueSerializer? initialValueDeserializer, List<
LiteValidator> ? validators, TextStyle? errorStyle, ValueChanged<DateTime?> ? onChanged, Object? initialValue, DateTime? maxDate, DateTime? minDate, DateFormat? format, Color? pickerBackgroundColor, AutovalidateMode? autovalidateMode, String? hintText, String? label, InputDecoration? decoration, DateInputType dateInputType = DateInputType.date, double paddingTop = 0.0, double paddingBottom = 0.0, double paddingLeft = 0.0, double paddingRight = 0.0, TextCapitalization textCapitalization = TextCapitalization.none, TextInputAction? textInputAction, TextStyle? style, StrutStyle? strutStyle, TextDirection? textDirection, FocusNode? focusNode, String? restorationId, TextAlignVertical? textAlignVertical, bool use24HourFormat = true, TextAlign textAlign = TextAlign.start, LiteDatePickerType pickerType = LiteDatePickerType.adaptive, TimePickerEntryMode initialEntryMode = TimePickerEntryMode.dial, EdgeInsets? smoothErrorPadding = const EdgeInsets.only(top: 6.0), bool useSmoothError = true, bool allowErrorTexts = true, bool readOnly = false})
Properties
- allowErrorTexts → bool
-
Pass false here if you don't want to display errors on invalid fields at all
final
- autovalidateMode → AutovalidateMode?
-
final
- dateInputType → DateInputType
-
final
- decoration → InputDecoration?
-
final
- errorStyle → TextStyle?
-
final
- focusNode → FocusNode?
-
final
- format → DateFormat?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hintText → String?
-
final
- initialEntryMode → TimePickerEntryMode
-
initial mode for a material picker. Makes sense only if
pickerType is LiteDatePickerType.material
final
- initialValue → Object?
-
It is assumed that the initial value is DateTime? but you might
also pass something else, for example a iso8601 String, and the
form field must be ok with it as long as you also pass an initialValueDeserializer
which will convert initial value into a DateTime object or else you will get an
exception
final
- initialValueDeserializer → LiteFormValueSerializer?
-
Allows you to convert initial value to a proper data type or
format before using it. E.g. you have a iso8601 format but you need
to have a DateTime object to work with in a date picker.
Use initialValueDeserializer to convert iso8601 value to a DateTime
like so: initialValueDeserializer: (value) => DateTime.parse(value);
and you will get a DateTime as an initial value. You can use any custom
conversions you want
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
final
- maxDate → DateTime?
-
final
- minDate → DateTime?
-
final
- name → String
-
final
-
onChanged
→ ValueChanged<
DateTime?> ? -
final
- paddingBottom → double
-
final
- paddingLeft → double
-
final
- paddingRight → double
-
final
- paddingTop → double
-
final
- pickerBackgroundColor → Color?
-
final
- pickerType → LiteDatePickerType
-
The look and feel of the picker
LiteDatePickerType.adaptive is selected by default
this means the picker will be automatically
set up according to the selected operating system
final
- readOnly → bool
-
final
- restorationId → String?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serializer → LiteFormValueSerializer
-
Allows you to prepare the data for some general usage like sending it
to an api endpoint. E.g. you have a Date Picker which returns a DateTime object
but you need to send it to a backend in a iso8601 string format.
Just pass the serializer like this: serializer: (value) => value.toIso8601String()
And it will always store this date as a string in a form map which you can easily send
wherever you need
final
- smoothErrorPadding → EdgeInsets?
-
makes sense only of useSmoothError is true
final
- strutStyle → StrutStyle?
-
final
- style → TextStyle?
-
final
- textAlign → TextAlign
-
final
- textAlignVertical → TextAlignVertical?
-
final
- textCapitalization → TextCapitalization
-
final
- textDirection → TextDirection?
-
final
- textInputAction → TextInputAction?
-
final
- use24HourFormat → bool
-
final
- useSmoothError → bool
-
if true, this will use a smoothly animated error
that uses AnimateSize to display, unlike the standard
Flutter's input error
final
-
validators
→ List<
LiteValidator> ? -
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< LiteDatePicker> -
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