BottomPicker class

Inheritance
Available Extensions

Constructors

BottomPicker({Key? key, required Widget pickerTitle, Widget? pickerDescription, required List<Widget>? items, Alignment? titleAlignment, EdgeInsetsGeometry titlePadding = const EdgeInsets.all(0), bool dismissable = false, dynamic onChange(dynamic)?, dynamic onSubmit(dynamic)?, Function? onClose, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, int selectedItemIndex = 0, double? buttonPadding, double? buttonWidth, Color? buttonSingleColor, Color backgroundColor = Colors.white, TextStyle pickerTextStyle = const TextStyle(fontSize: 14, color: Colors.black), double itemExtent = 35.0, bool displayCloseIcon = true, @Deprecated('Will be removed, if not null `onClose` will override the close button onTap function') bool popOnClose = true, Color closeIconColor = Colors.black, double closeIconSize = 20, LayoutOrientation layoutOrientation = LayoutOrientation.ltr, MainAxisAlignment buttonAlignment = MainAxisAlignment.center, double? height, bool displaySubmitButton = true, Widget? selectionOverlay, Widget? buttonContent, BoxDecoration? buttonStyle})
BottomPicker.date({Key? key, required Widget pickerTitle, Widget? pickerDescription, EdgeInsetsGeometry titlePadding = const EdgeInsets.all(0), Alignment? titleAlignment, bool dismissable = false, dynamic onChange(dynamic)?, dynamic onSubmit(dynamic)?, Function? onClose, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, DateTime? initialDateTime, DateTime? minDateTime, DateTime? maxDateTime, double? buttonPadding, double? buttonWidth, Color? buttonSingleColor, Color backgroundColor = Colors.white, DatePickerDateOrder? dateOrder = DatePickerDateOrder.ymd, TextStyle pickerTextStyle = const TextStyle(fontSize: 14, color: Colors.black), bool displayCloseIcon = true, @Deprecated('Will be removed, if not null `onClose` will override the close button onTap function') bool popOnClose = true, Color closeIconColor = Colors.black, double closeIconSize = 20, LayoutOrientation layoutOrientation = LayoutOrientation.ltr, MainAxisAlignment buttonAlignment = MainAxisAlignment.center, double? height, bool displaySubmitButton = true, Widget? buttonContent, BoxDecoration? buttonStyle})
BottomPicker.dateTime({Key? key, required Widget pickerTitle, Widget? pickerDescription, EdgeInsetsGeometry titlePadding = const EdgeInsets.all(0), Alignment? titleAlignment, bool dismissable = false, dynamic onChange(dynamic)?, dynamic onSubmit(dynamic)?, Function? onClose, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, DateTime? initialDateTime, int? minuteInterval, DateTime? minDateTime, DateTime? maxDateTime, bool use24hFormat = false, double? buttonPadding, double? buttonWidth, Color? buttonSingleColor, Color backgroundColor = Colors.white, DatePickerDateOrder? dateOrder = DatePickerDateOrder.ymd, TextStyle pickerTextStyle = const TextStyle(fontSize: 14, color: Colors.black), bool displayCloseIcon = true, @Deprecated('Will be removed, if not null `onClose` will override the close button onTap function') bool popOnClose = true, Color closeIconColor = Colors.black, double closeIconSize = 20, LayoutOrientation layoutOrientation = LayoutOrientation.ltr, MainAxisAlignment buttonAlignment = MainAxisAlignment.center, double? height, bool displaySubmitButton = true, Widget? buttonContent, BoxDecoration? buttonStyle})
BottomPicker.range({Key? key, required Widget pickerTitle, Widget? pickerDescription, required dynamic onRangeDateSubmitPressed(DateTime, DateTime)?, EdgeInsetsGeometry titlePadding = const EdgeInsets.all(0), Alignment? titleAlignment, bool dismissable = false, Function? onClose, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, double? buttonPadding, double? buttonWidth, Color? buttonSingleColor, Color backgroundColor = Colors.white, TextStyle pickerTextStyle = const TextStyle(fontSize: 14, color: Colors.black), bool displayCloseIcon = true, @Deprecated('Will be removed, if not null `onClose` will override the close button onTap function') bool popOnClose = true, Color closeIconColor = Colors.black, double closeIconSize = 20, LayoutOrientation layoutOrientation = LayoutOrientation.ltr, MainAxisAlignment buttonAlignment = MainAxisAlignment.center, double? height, DateTime? initialSecondDate, DateTime? initialFirstDate, DateTime? minFirstDate, DateTime? minSecondDate, DateTime? maxFirstDate, DateTime? maxSecondDate, DatePickerDateOrder? dateOrder = DatePickerDateOrder.ymd, Widget? buttonContent, BoxDecoration? buttonStyle})
BottomPicker.time({Key? key, required Widget pickerTitle, Widget? pickerDescription, required Time? initialTime, Time? maxTime, Time? minTime, EdgeInsetsGeometry titlePadding = const EdgeInsets.all(0), Alignment? titleAlignment, bool dismissable = false, dynamic onChange(dynamic)?, dynamic onSubmit(dynamic)?, Function? onClose, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, int? minuteInterval = 1, bool use24hFormat = false, double? buttonPadding, double? buttonWidth, Color? buttonSingleColor, Color backgroundColor = Colors.white, TextStyle pickerTextStyle = const TextStyle(fontSize: 14, color: Colors.black), bool displayCloseIcon = true, @Deprecated('Will be removed, if not null `onClose` will override the close button onTap function') bool popOnClose = true, Color closeIconColor = Colors.black, double closeIconSize = 20, LayoutOrientation layoutOrientation = LayoutOrientation.ltr, MainAxisAlignment buttonAlignment = MainAxisAlignment.center, double? height, bool displaySubmitButton = true, Widget? buttonContent, BoxDecoration? buttonStyle})

Properties

backgroundColor Color
the bottom picker background color, by default it's white
final
bottomPickerTheme BottomPickerTheme
set the theme of the bottom picker (the button theme) possible values
final
bottomPickerType BottomPickerType
the bottom picker type
getter/setter pair
buttonAlignment MainAxisAlignment
THe alignment of the bottom picker button by default it's MainAxisAlignment.center
final
buttonContent Widget?
The button's widget that will be displayed if null the button will have a simple 'Select' text in the center
final
buttonPadding double?
the padding that will be applied to the button if the padding is null the button will be rendered null
final
buttonSingleColor Color?
a single color will be applied to the button instead of the gradient themes
final
buttonStyle BoxDecoration?
the style that will be applied on the button's widget
final
buttonWidth double?
the width that will be applied to the button if the buttonWidth is null the button will be rendered with null
final
closeIconColor Color
the close icon color by default closeIconColor = Colors.black
final
closeIconSize double
the close icon size by default closeIconSize = 20
final
dateOrder DatePickerDateOrder?
date order applied on date picker or date time picker by default it's YYYY/MM/DD
getter/setter pair
datePickerMode CupertinoDatePickerMode
The dateTime picker mode CupertinoDatePickerMode.date or CupertinoDatePickerMode.dateAndTime or CupertinoDatePickerMode.time
getter/setter pair
dismissable bool
defines whether the bottom picker is dismissable or not by default it's set to false
final
displayCloseIcon bool
indicate whether the close icon will be rendred or not by default displayCloseIcon = true
final
displaySubmitButton bool
indicates if the submit button will be displayed or not by default the submit button is shown
getter/setter pair
gradientColors List<Color>?
to set a custom button theme color use this list when it's not null it will be applied
final
hashCode int
The hash code for this object.
no setterinherited
height double?
bottom picker main widget height if it's null the bottom picker will get the height from bottomPickerHeight extension on context
final
initialDateTime DateTime?
The initial date time applied on the date and time picker by default it's null
getter/setter pair
initialFirstDate DateTime?
the initial first date in the date range picker not required if null no minimum will be set in the date picker
getter/setter pair
initialSecondDate DateTime?
the initial last date in the date range picker not required if null no minimum will be set in the date picker
getter/setter pair
initialTime Time?
The initial time set in the time picker widget required only when using the time constructor
getter/setter pair
itemExtent double
define the picker item extent available only for list items picker by default it's 35
getter/setter pair
items List<Widget>?
list of items (List of widgets) used to create simple item picker (required) and should not be empty or null
getter/setter pair
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
layoutOrientation LayoutOrientation
the layout orientation of the bottom picker by default the orientation is set to LTR
final
maxDateTime DateTime?
the max date time on the date picker by default it's null
getter/setter pair
maxFirstDate DateTime?
the maximum first date in the date range picker not required if null no minimum will be set in the date picker
getter/setter pair
maxSecondDate DateTime?
the maximum second date in the date range picker not required if null no minimum will be set in the date picker
getter/setter pair
maxTime Time?
The max time can be set in the time picker widget
getter/setter pair
minDateTime DateTime?
the minimum date & time applied on the date picker by default it's null
getter/setter pair
minFirstDate DateTime?
the minimum first date in the date range picker not required if null no minimum will be set in the date picker
getter/setter pair
minSecondDate DateTime?
the minimum second date in the date range picker not required if null no minimum will be set in the date picker
getter/setter pair
minTime Time?
The min time can be set in the time picker widget
getter/setter pair
minuteInterval int?
The gap between two minutes by default it's 1 minute
getter/setter pair
onChange ↔ (dynamic Function(dynamic)?)
Nullable function, invoked when navigating between picker items whether it's date picker or simple item picker it will return a value DateTime or int(index)
getter/setter pair
onClose Function?
Invoked when clicking on the close button
final
onRangeDateSubmitPressed ↔ (dynamic Function(DateTime, DateTime)?)
invoked when pressing on the submit button when using range picker it return two dates (first date, end date) required when using BottomPicker.range
getter/setter pair
onSubmit ↔ (dynamic Function(dynamic)?)
Nullable function invoked when clicking on submit button if the picker type is date/time/dateTime it will return DateTime value else it will return the index of the selected item
getter/setter pair
pickerDescription Widget?
Bottom picker description widget
final
pickerTextStyle TextStyle
the picker text style applied on all types of bottom picker by default TextStyle(fontSize: 14)
final
pickerTitle Widget
final
popOnClose bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedItemIndex int
used for simple bottom picker by default it's 0, needs to be in the range 0, this.items.length-1 otherwise an exception will be thrown for date and time picker type this parameter is not available
getter/setter pair
selectionOverlay Widget?
A widget overlaid on the picker to highlight the currently selected entry. The selectionOverlay widget drawn above the CupertinoPicker's picker wheel.
getter/setter pair
titleAlignment Alignment?
Title widget alignment inside the stack by default the title will be aligned left/right depends on layoutOrientation
final
titlePadding EdgeInsetsGeometry
The padding applied on the title by default it is set with zero values
final
use24hFormat bool
define whether the time uses 24h or 12h format by default it's false (12h format)
getter/setter pair

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _BottomPickerState
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
show(BuildContext context) → void
display the bottom picker popup context the app context to display the popup
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