FormeDateTimeField class
example :
FormeDateTimeField(
type: FormeDateTimeType.dateTime,
validator: (field, value) {
if (value == null) {
return 'datetime required';
}
return null;
},
triggerBuilder: (state) {
return InkWell(
focusNode: state.focusNode,
onTap: state.showDateTimePicker,
child: InputDecorator(
isFocused: state.hasFocus,
isEmpty: state.value == null,
decoration: InputDecoration(
errorText: state.errorText,
labelText: 'Date Time Picker'),
child: Text(state.formattedValue ?? ''),
),
);
},
name: 'datetime',
),
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FormeDateTimeField
Constructors
-
FormeDateTimeField({Key? key, String? name, DateTime? initialValue, FormeAsyncValidator<
DateTime?> ? asyncValidator, Duration? asyncValidatorDebounce, AutovalidateMode? autovalidateMode, bool enabled = true, FocusNode? focusNode, FormeFieldInitialized<DateTime?> ? onInitialized, FormeFieldSetter<DateTime?> ? onSaved, FormeFieldStatusChanged<DateTime?> ? onStatusChanged, int? order, bool quietlyValidate = false, bool readOnly = false, bool requestFocusOnUserInteraction = true, FormeFieldValidationFilter<DateTime?> ? validationFilter, FormeValidator<DateTime?> ? validator, FormeFieldDecorator<DateTime?> ? decorator, String? cancelText, String? confirmText, DatePickerEntryMode? dateInitialEntryMode, String? errorFormatText, String? errorInvalidText, String? fieldHintText, String? fieldLabelText, String? helpText, DatePickerMode? initialDatePickerMode, TimePickerEntryMode? initialEntryMode, RouteSettings? routeSettings, SelectableDayPredicate? selectableDayPredicate, String? timeCancelText, String? timeConfirmText, String? timeHelpText, RouteSettings? timeRouteSettings, TransitionBuilder? dateTransitionBuilder, bool use24hFormat = false, TransitionBuilder? timeTransitionBuilder, TextDirection? textDirection, Locale? locale, Offset? anchorPoint, TextInputType? keyboardType, String? hourLabelText, String? minuteLabelText, EntryModeChangeCallback? onEntryModeChanged, Offset? timeAnchorPoint, String? timeErrorInvalidText, FormeDateTimeType type = FormeDateTimeType.date, DateTime? firstDate, DateTime? lastDate, required FormeDateTimeTriggerBuilder triggerBuilder})
Properties
- anchorPoint → Offset?
-
final
-
asyncValidator
→ FormeAsyncValidator<
DateTime?> ? -
used to perform an async validation
finalinherited
- asyncValidatorDebounce → Duration?
-
not worked when validate manually
finalinherited
- autovalidateMode → AutovalidateMode
-
finalinherited
-
builder
→ FormeFieldBuilder<
DateTime?> -
finalinherited
- cancelText → String?
-
final
- confirmText → String?
-
final
- dateInitialEntryMode → DatePickerEntryMode?
-
final
- dateTransitionBuilder → TransitionBuilder?
-
final
-
decorator
→ FormeFieldDecorator<
DateTime?> ? -
used to decorate field
finalinherited
- enabled → bool
-
whether field is enabled,
finalinherited
- errorFormatText → String?
-
final
- errorInvalidText → String?
-
final
- fieldHintText → String?
-
final
- fieldLabelText → String?
-
final
- fieldType → Type
-
no setterinherited
- firstDate → DateTime?
-
final
- focusNode → FocusNode?
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- helpText → String?
-
final
- hourLabelText → String?
-
final
- initialDatePickerMode → DatePickerMode?
-
final
- initialEntryMode → TimePickerEntryMode?
-
final
- initialValue → DateTime?
-
initial value
finalinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardType → TextInputType?
-
final
- lastDate → DateTime?
-
final
- locale → Locale?
-
final
- minuteLabelText → String?
-
final
- name → String?
-
field name
finalinherited
- onEntryModeChanged → EntryModeChangeCallback?
-
final
-
onInitialized
→ FormeFieldInitialized<
DateTime?> ? -
called immediately after
FormeFieldState.initStatus
finalinherited -
onSaved
→ FormeFieldSetter<
DateTime?> ? -
finalinherited
-
onStatusChanged
→ FormeFieldStatusChanged<
DateTime?> ? -
listen field status change
finalinherited
- order → int?
-
used to support
Forme.autovalidateByOrder
finalinherited - quietlyValidate → bool
-
quietlyValidate
finalinherited
- readOnly → bool
-
finalinherited
- requestFocusOnUserInteraction → bool
-
whether request focus when field value changed
finalinherited
- routeSettings → RouteSettings?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectableDayPredicate → SelectableDayPredicate?
-
final
- textDirection → TextDirection?
-
final
- timeAnchorPoint → Offset?
-
final
- timeCancelText → String?
-
final
- timeConfirmText → String?
-
final
- timeErrorInvalidText → String?
-
final
- timeHelpText → String?
-
final
- timeRouteSettings → RouteSettings?
-
final
- timeTransitionBuilder → TransitionBuilder?
-
final
- triggerBuilder → FormeDateTimeTriggerBuilder
-
final
- type → FormeDateTimeType
-
final
- use24hFormat → bool
-
final
-
final
-
validationFilter
→ FormeFieldValidationFilter<
DateTime?> ? -
used to determine whether perform a validation
finalinherited
-
validator
→ FormeValidator<
DateTime?> ? -
sync validator
finalinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → FormeDateTimeFieldState - Creates the mutable state for this widget at a given location in the tree.
-
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
Static Methods
-
defaultTriggerBuilder(
FormeDateTimeFieldState state, {InputDecoration? decoration, String formatter(DateTime? time)?, bool clearButton = true}) → Widget