TimePickerSheet class

Using date time format to initialize data and also for the final result. the sheet only care about the hour and minute values, the other will be ignored.

Inheritance

Constructors

TimePickerSheet({Key? key, required String sheetTitle, required String minuteTitle, required String hourTitle, required String saveButtonText, DateTime? initialDateTime, int minuteInterval = 15, int hourInterval = 1, int minHour = 0, int maxHour = 24, int minMinute = 0, int maxMinute = 60, bool twoDigit = true, IconData sheetCloseIcon = Icons.close, Color sheetCloseIconColor = Colors.redAccent, Color saveButtonColor = Colors.redAccent, TextStyle sheetTitleStyle = const TextStyle(fontWeight: FontWeight.bold, fontSize: 16), TextStyle hourTitleStyle = const TextStyle(fontWeight: FontWeight.bold, color: Colors.redAccent, fontSize: 16), TextStyle minuteTitleStyle = const TextStyle(fontWeight: FontWeight.bold, color: Colors.redAccent, fontSize: 16), TextStyle wheelNumberItemStyle = const TextStyle(fontSize: 14), TextStyle wheelNumberSelectedStyle = const TextStyle(fontWeight: FontWeight.bold, color: Colors.redAccent, fontSize: 16)})

Properties

hashCode int
The hash code for this object.
no setterinherited
hourInterval int
will be used as a hour interval, the default value is 1 but you can adjust based on your needs from screen. if the value is 1 then the options will be start from 0 to 23.
final
hourTitle String
final
hourTitleStyle TextStyle
final
initialDateTime DateTime?
you can set initial date time from screen, so if time picker sheet opened will be directly selected the time based on initialDateTime. but this is optional, if initialDateTime not set the selected time will be 0 because using _defaultDateTime.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxHour int
max hour should be >= 0 && <= 24. outside the range will trigger an error on the screen.
final
maxMinute int
max minute should be >= 0 && <= 60. outside the range will trigger an error on the screen.
final
minHour int
min hour should be >= 0 && <= 24. outside the range will trigger an error on the screen.
final
minMinute int
min minute should be >= 0 && <= 60. outside the range will trigger an error on the screen.
final
minuteInterval int
will be used as a minute interval, the default value is 15 but you can adjust based on your needs from screen. if the value is 15 then the options will be 0, 15, 30, 45.
final
minuteTitle String
final
minuteTitleStyle TextStyle
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
saveButtonColor Color
final
saveButtonText String
final
sheetCloseIcon IconData
final
sheetCloseIconColor Color
final
sheetTitle String
title on the top of the sheet.
final
sheetTitleStyle TextStyle
you can customize the style to align with your requirement.
final
twoDigit bool
to enable two digit format in time picker sheet, the default value is false. When this format enabled the return value/result is still using one digit. Ex: you select 03:45 then the result would be 3:45. so you don't need to reformat or mapping anything on the screen.
final
wheelNumberItemStyle TextStyle
final
wheelNumberSelectedStyle TextStyle
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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}) 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