BottomPicker<T> class

Inheritance
Available extensions

Constructors

BottomPicker({Key? key, required List<T>? items, Widget itemBuilder(T item, int index)?, bool dismissable = false, dynamic onChange(T)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') dynamic onSubmit(T?)?, dynamic onDismiss(T?)?, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, int selectedItemIndex = 0, Color backgroundColor = Colors.white, CupertinoTextThemeData? pickerThemeData, double itemExtent = 35.0, TextDirection? layoutOrientation = TextDirection.ltr, double? height, Widget? selectionOverlay, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') bool? closeOnSubmit = true, Widget headerBuilder(BuildContext context)?, double diameterRatio = 1.1, bool useSafeArea = false, SearchItemPredicate<T>? filterPredicate, TextInputAction? textInputAction, InputDecoration? searchFieldDecoration, Widget buttonBuilder(BottomPicker instance, BuildContext context)?, @Deprecated('Use buttonBuilder instead') bool displaySubmitButton = true, @Deprecated('Use buttonBuilder instead') Widget? buttonContent, @Deprecated('Use buttonBuilder instead') BoxDecoration? buttonStyle, @Deprecated('Use buttonBuilder instead') MainAxisAlignment buttonAlignment = MainAxisAlignment.center, @Deprecated('Use buttonBuilder instead') Color? buttonSingleColor, @Deprecated('Use buttonBuilder instead') double? buttonPadding, @Deprecated('Use buttonBuilder instead') double? buttonWidth, TextStyle? pickerTextStyle})
BottomPicker.date({Key? key, bool dismissable = false, dynamic onChange(T)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') dynamic onSubmit(T?)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') bool? closeOnSubmit = true, dynamic onDismiss(T?)?, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, DateTime? initialDateTime, DateTime? minDateTime, DateTime? maxDateTime, Color backgroundColor = Colors.white, DatePickerDateOrder? dateOrder = DatePickerDateOrder.ymd, CupertinoTextThemeData? pickerThemeData, TextDirection? layoutOrientation = TextDirection.ltr, double? height, double itemExtent = 35.0, Widget headerBuilder(BuildContext context)?, List<int> calendarDays = CupertinoDatePickerWidget.fullWeek, double diameterRatio = 1.1, bool useSafeArea = false, Widget buttonBuilder(BottomPicker instance, BuildContext context)?, @Deprecated('Use buttonBuilder instead') bool displaySubmitButton = true, @Deprecated('Use buttonBuilder instead') Widget? buttonContent, @Deprecated('Use buttonBuilder instead') BoxDecoration? buttonStyle, @Deprecated('Use buttonBuilder instead') MainAxisAlignment buttonAlignment = MainAxisAlignment.center, @Deprecated('Use buttonBuilder instead') Color? buttonSingleColor, @Deprecated('Use buttonBuilder instead') double? buttonPadding, @Deprecated('Use buttonBuilder instead') double? buttonWidth, TextStyle? pickerTextStyle})
BottomPicker.dateTime({Key? key, bool dismissable = false, dynamic onChange(T)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') dynamic onSubmit(T?)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') bool? closeOnSubmit = true, dynamic onDismiss(T?)?, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, DateTime? initialDateTime, int minuteInterval = 1, DateTime? minDateTime, DateTime? maxDateTime, bool use24hFormat = false, Color backgroundColor = Colors.white, DatePickerDateOrder? dateOrder = DatePickerDateOrder.ymd, CupertinoTextThemeData? pickerThemeData, TextDirection? layoutOrientation = TextDirection.ltr, double? height, double itemExtent = 30, bool showTimeSeparator = false, Widget headerBuilder(BuildContext context)?, List<int> calendarDays = CupertinoDatePickerWidget.fullWeek, double diameterRatio = 1.1, SelectableHourPredicate? hourPredicate, bool useSafeArea = false, Widget buttonBuilder(BottomPicker instance, BuildContext context)?, @Deprecated('Use buttonBuilder instead') bool displaySubmitButton = true, @Deprecated('Use buttonBuilder instead') Widget? buttonContent, @Deprecated('Use buttonBuilder instead') BoxDecoration? buttonStyle, @Deprecated('Use buttonBuilder instead') MainAxisAlignment buttonAlignment = MainAxisAlignment.center, @Deprecated('Use buttonBuilder instead') Color? buttonSingleColor, @Deprecated('Use buttonBuilder instead') double? buttonPadding, @Deprecated('Use buttonBuilder instead') double? buttonWidth, TextStyle? pickerTextStyle})
BottomPicker.monthYear({Key? key, bool dismissable = false, dynamic onChange(T)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') dynamic onSubmit(T?)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') bool? closeOnSubmit = true, dynamic onDismiss(T?)?, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, DateTime? initialDateTime, DateTime? minDateTime, DateTime? maxDateTime, Color backgroundColor = Colors.white, CupertinoTextThemeData? pickerThemeData, TextDirection? layoutOrientation = TextDirection.ltr, double? height, double itemExtent = 35.0, Widget headerBuilder(BuildContext context)?, List<int> calendarDays = CupertinoDatePickerWidget.fullWeek, double diameterRatio = 1.1, bool useSafeArea = false, Widget buttonBuilder(BottomPicker instance, BuildContext context)?, @Deprecated('Use buttonBuilder instead') bool displaySubmitButton = true, @Deprecated('Use buttonBuilder instead') Widget? buttonContent, @Deprecated('Use buttonBuilder instead') BoxDecoration? buttonStyle, @Deprecated('Use buttonBuilder instead') MainAxisAlignment buttonAlignment = MainAxisAlignment.center, @Deprecated('Use buttonBuilder instead') Color? buttonSingleColor, @Deprecated('Use buttonBuilder instead') double? buttonPadding, @Deprecated('Use buttonBuilder instead') double? buttonWidth, TextStyle? pickerTextStyle})
BottomPicker.range({Key? key, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') bool? closeOnSubmit = true, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') dynamic onRangeDateSubmitPressed(DateTime?, DateTime?)?, dynamic onRangePickerDismissed(DateTime?, DateTime?)?, bool dismissable = false, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, Color backgroundColor = Colors.white, CupertinoTextThemeData? pickerThemeData, TextDirection? layoutOrientation = TextDirection.ltr, double? height, DateTime? initialSecondDate, DateTime? initialFirstDate, DateTime? minFirstDate, DateTime? minSecondDate, DateTime? maxFirstDate, DateTime? maxSecondDate, DatePickerDateOrder? dateOrder = DatePickerDateOrder.ymd, double itemExtent = 30, Widget headerBuilder(BuildContext context)?, List<int> calendarDays = CupertinoDatePickerWidget.fullWeek, double diameterRatio = 1.1, bool useSafeArea = false, Widget buttonBuilder(BottomPicker instance, BuildContext context)?, @Deprecated('Use buttonBuilder instead') bool displaySubmitButton = true, @Deprecated('Use buttonBuilder instead') Widget? buttonContent, @Deprecated('Use buttonBuilder instead') BoxDecoration? buttonStyle, @Deprecated('Use buttonBuilder instead') MainAxisAlignment buttonAlignment = MainAxisAlignment.center, @Deprecated('Use buttonBuilder instead') Color? buttonSingleColor, @Deprecated('Use buttonBuilder instead') double? buttonPadding, @Deprecated('Use buttonBuilder instead') double? buttonWidth, TextStyle? pickerTextStyle})
BottomPicker.rangeTime({Key? key, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') bool? closeOnSubmit = true, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') dynamic onRangeTimeSubmitPressed(DateTime?, DateTime?)?, dynamic onRangePickerDismissed(DateTime?, DateTime?)?, bool use24hFormat = true, bool dismissable = false, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, Color backgroundColor = Colors.white, CupertinoTextThemeData? pickerThemeData, TextDirection? layoutOrientation = TextDirection.ltr, double? height, DateTime? initialSecondTime, DateTime? initialFirstTime, DateTime? minFirstTime, DateTime? minSecondTime, DateTime? maxFirstTime, DateTime? maxSecondTime, int minuteInterval = 1, bool showTimeSeparator = false, double itemExtent = 30, Widget headerBuilder(BuildContext context)?, List<int> calendarDays = CupertinoDatePickerWidget.fullWeek, double diameterRatio = 1.1, bool useSafeArea = false, Widget buttonBuilder(BottomPicker instance, BuildContext context)?, @Deprecated('Use buttonBuilder instead') bool displaySubmitButton = true, @Deprecated('Use buttonBuilder instead') Widget? buttonContent, @Deprecated('Use buttonBuilder instead') BoxDecoration? buttonStyle, @Deprecated('Use buttonBuilder instead') MainAxisAlignment buttonAlignment = MainAxisAlignment.center, @Deprecated('Use buttonBuilder instead') Color? buttonSingleColor, @Deprecated('Use buttonBuilder instead') double? buttonPadding, @Deprecated('Use buttonBuilder instead') double? buttonWidth, TextStyle? pickerTextStyle})
BottomPicker.time({Key? key, required Time? initialTime, Time? maxTime, Time? minTime, bool dismissable = false, dynamic onChange(T)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') dynamic onSubmit(T?)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') bool? closeOnSubmit = true, dynamic onDismiss(T?)?, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, int minuteInterval = 1, bool use24hFormat = false, Color backgroundColor = Colors.white, CupertinoTextThemeData? pickerThemeData, TextDirection? layoutOrientation = TextDirection.ltr, double? height, bool showTimeSeparator = false, double itemExtent = 30, Widget headerBuilder(BuildContext context)?, List<int> calendarDays = CupertinoDatePickerWidget.fullWeek, double diameterRatio = 1.1, bool useSafeArea = false, Widget buttonBuilder(BottomPicker instance, BuildContext context)?, @Deprecated('Use buttonBuilder instead') bool displaySubmitButton = true, @Deprecated('Use buttonBuilder instead') Widget? buttonContent, @Deprecated('Use buttonBuilder instead') BoxDecoration? buttonStyle, @Deprecated('Use buttonBuilder instead') MainAxisAlignment buttonAlignment = MainAxisAlignment.center, @Deprecated('Use buttonBuilder instead') Color? buttonSingleColor, @Deprecated('Use buttonBuilder instead') double? buttonPadding, @Deprecated('Use buttonBuilder instead') double? buttonWidth, TextStyle? pickerTextStyle})
BottomPicker.timer({Key? key, CupertinoTimerPickerMode? timerPickerMode = CupertinoTimerPickerMode.hm, int timerSecondsInterval = 1, Duration? initialTimerDuration, bool dismissable = false, dynamic onChange(T)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') dynamic onSubmit(T?)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') bool? closeOnSubmit = true, dynamic onDismiss(T?)?, double itemExtent = 30, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, int minuteInterval = 1, Color backgroundColor = Colors.white, CupertinoTextThemeData? pickerThemeData, TextDirection? layoutOrientation = TextDirection.ltr, double? height, Widget headerBuilder(BuildContext context)?, List<int> calendarDays = CupertinoDatePickerWidget.fullWeek, double diameterRatio = 1.1, Widget buttonBuilder(BottomPicker instance, BuildContext context)?, bool useSafeArea = false, @Deprecated('Use buttonBuilder instead') bool displaySubmitButton = true, @Deprecated('Use buttonBuilder instead') Widget? buttonContent, @Deprecated('Use buttonBuilder instead') BoxDecoration? buttonStyle, @Deprecated('Use buttonBuilder instead') MainAxisAlignment buttonAlignment = MainAxisAlignment.center, @Deprecated('Use buttonBuilder instead') Color? buttonSingleColor, @Deprecated('Use buttonBuilder instead') double? buttonPadding, @Deprecated('Use buttonBuilder instead') double? buttonWidth, TextStyle? pickerTextStyle})
BottomPicker.year({Key? key, bool dismissable = false, dynamic onChange(T)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') dynamic onSubmit(T?)?, @Deprecated('Use buttonBuilder with a callback widget to handle the onSubmit action instead') bool? closeOnSubmit = true, dynamic onDismiss(T?)?, BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue, List<Color>? gradientColors, DateTime? initialDateTime, DateTime? minDateTime, DateTime? maxDateTime, Color backgroundColor = Colors.white, CupertinoTextThemeData? pickerThemeData, double? height, double itemExtent = 35.0, double diameterRatio = 1.1, Widget headerBuilder(BuildContext context)?, bool useSafeArea = false, Widget buttonBuilder(BottomPicker instance, BuildContext context)?, @Deprecated('Use buttonBuilder instead') bool displaySubmitButton = true, @Deprecated('Use buttonBuilder instead') Widget? buttonContent, @Deprecated('Use buttonBuilder instead') BoxDecoration? buttonStyle, @Deprecated('Use buttonBuilder instead') MainAxisAlignment buttonAlignment = MainAxisAlignment.center, @Deprecated('Use buttonBuilder instead') Color? buttonSingleColor, @Deprecated('Use buttonBuilder instead') double? buttonPadding, @Deprecated('Use buttonBuilder instead') double? buttonWidth, TextStyle? pickerTextStyle})
Creates a bottom picker for selecting a year.

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
buttonBuilder Widget Function(BottomPicker instance, BuildContext context)?
The button builder callback that will be used to build the button widget. If this is provided, it will override the default button widget and any other button-related properties The callback takes:
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
calendarDays List<int>
The datepicker calendar type
getter/setter pair
closeOnSubmit bool?
Indiacate whether the bottom picker will be closed (poped out of the Navigator) when the submit button is pressed. By default closeOnSubmit = true.
getter/setter pair
currentFirstDateTime DateTime?
no setter
currentSecondDateTime DateTime?
no setter
currentValue → T?
no setter
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
diameterRatio double
The bottom picker selector diameter ratio.
final
dismissable bool
defines whether the bottom picker is dismissable or not by default it's set to false
final
displaySubmitButton bool
indicates if the submit button will be displayed or not by default the submit button is shown
getter/setter pair
disposed bool
getter/setter pair
filterPredicate SearchItemPredicate<T>?
Predicate function used to filter items in the search field if not null the search field will be displayed and the user can filter the items based on the predicate Takes two parameters: the item and the search query, and returns a boolean indicating whether the item should be filtered out or not.
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
headerBuilder Widget Function(BuildContext context)?
Renders the header component of the bottom picker
final
height double?
bottom picker main widget height if it's null the bottom picker will get the height from bottomPickerHeight extension on context
final
hourPredicate SelectableHourPredicate?
A predicate that can be used to select which hours are selectable.
getter/setter pair
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
initialFirstTime DateTime?
the initial first time in the time range picker not required if null no minimum will be set in the time 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
initialSecondTime DateTime?
the initial last time in the time range picker not required if null no minimum will be set in the time 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
initialTimerDuration Duration?
The initial duration set for the timer picker By default it's set to null so it's Duration.zero
getter/setter pair
itemBuilder Widget Function(T item, int index)?
Callback function used to build the item widget for each item in the list. only for simple item picker, for date/time/dateTime picker this parameter is not available if Null the picker will display Text widget with the item.toString() value
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<T>?
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 TextDirection?
the layout orientation of the bottom picker by default the orientation is set to LTR
getter/setter pair
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
maxFirstTime DateTime?
the maximum first time in the time range picker not required if null no minimum will be set in the time 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
maxSecondTime DateTime?
the maximum second time in the time range picker not required if null no minimum will be set in the time 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
minFirstTime DateTime?
the minimum first time in the time range picker not required if null no minimum will be set in the time 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
minSecondTime DateTime?
the minimum second time in the time range picker not required if null no minimum will be set in the time 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(T)?
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
onCloseButtonPressed Function?
Invoked when clicking on the close button
getter/setter pair
onDismiss ↔ dynamic Function(T?)?
Nullable function invoked when the picker get dismissed it will return the selected value
getter/setter pair
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
onRangePickerDismissed ↔ dynamic Function(DateTime?, DateTime?)?
Function invoked when the picker is dismissed used with range picker and time range picker.
getter/setter pair
onRangeTimeSubmitPressed ↔ dynamic Function(DateTime?, DateTime?)?
Invoked when pressing on the submit button when using range picker it return two dates (first time, end time) required when using BottomPicker.rangeTime
getter/setter pair
onSubmit ↔ dynamic Function(T?)?
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
pickerTextStyle TextStyle?
the picker text style applied on all types of bottom picker by default TextStyle(fontSize: 14)
getter/setter pair
pickerThemeData CupertinoTextThemeData?
The picker theme data
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchFieldDecoration InputDecoration?
The decoration for the search field, which allows customization of the appearance of the search field.
getter/setter pair
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
showTimeSeparator bool
Indicates whether the time seperator (":") will be shown or not.
getter/setter pair
textInputAction TextInputAction?
The search field text input action, which determines the action button on the keyboard.
getter/setter pair
timerPickerMode CupertinoTimerPickerMode?
The time picker mode "hm", "hms" or "ms" By default it's set to "hm"
getter/setter pair
timerSecondsInterval int
The timer seconds interval Cannot be less then 1
getter/setter pair
use24hFormat bool
define whether the time uses 24h or 12h format by default it's false (12h format)
getter/setter pair
useSafeArea bool
Indicates whether to use SafeArea to avoid content overflow.
final

Methods

assertInitialValues() → void

Available on BottomPicker, provided by the BottomPickerExtension extension

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() BottomPickerState<T>
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
dismiss() → void
Dismiss the bottom picker popup
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, 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