textfield_datepicker 0.2.0

SDKflutter
Platformandroidioswindowslinuxmacosweb

TextfieldDatePicker, TextfieldDateAndTimePicker, and TextfieldTimePicker are three flutter widgets that you can use together. These widgets provide you access to different platform date and time pickers depending on your device platform.

textfield_datepicker

A collection of three flutter widget TextfieldDatePicker, TextfieldDateAndTimePicker and TextfieldTimePicker. These widgets gives you access to the various platform date and time pickers based on your device platform.

The date or time picked is shown in a Material TextFormField widget. These three widgets earlier mentioned gives you access to most of Material TextFormField parameters allowing you to design your textfield based on your preference

Screenshots of how it works

For screenshots of how this package works, visit this link

See example for details of how this package works

Installation

Add the textfield_datepicker package to your pubspec.yml file.

dependencies:
  textfield_datepicker: ^0.2.0

Import the package into your dart file

import 'package:textfield_datepicker/textfield_datepicker.dart';
import 'package:textfield_datepicker/textfield_dateAndTimePicker.dart';
import 'package:textfield_datepicker/textfield_timePicker.dart';

Usage

TextfieldDatePicker

PropertyDefaultDescription
materialDatePickerInitialEntryModeDatePickerEntryMode.calendarIn DatePickerEntryMode.calendar mode, a calendar grid is displayed and the user taps the day they wish to select. In DatePickerEntryMode.input mode a TextField is displayed and the user types in the date they wish to select..
materialDatePickerFirstDaterequiredThe materialDatePickerFirstDate parameter is the earliest allowable date.
materialDatePickerInitialDaterequiredWhen the date picker is first displayed, it will show the month of materialDatePickerInitialDate, with materialDatePickerInitialDate selected.
materialDatePickerLastDaterequiredThe materialDatePickerLastDate parameter is the latest allowable date.
preferredDateFormatrequiredThe preferredDateFormat parameter is for formatting and parsing dates in a locale-sensitive manner.
materialDatePickerBuilderoptionalThe materialDatePickerBuilder parameter can be used to wrap the dialog widget to add inherited widgets like Theme.
materialDatePickerLocaleoptionalmaterialDatePickerLocale optional locale argument can be used to set the locale for the date picker. It defaults to the ambient locale provided by Localizations.
materialDatePickerSelectableDayPredicateoptionalAn optional materialDatePickerSelectableDayPredicate function can be passed in to only allow certain days for selection.
cupertinoDatePickerMaximumDaterequiredThe cupertinoDatePickerMaximumDate parameter is the maximum selectable date that the picker can settle on.
cupertinoDatePickerMinimumDaterequiredThe cupertinoDatePickerMinimumDate is the minimum selectable date that the picker can settle on.
cupertinoDatePickerMinimumYearoptionalThe cupertinoDatePickerMinimumYear parameter is the minimum year that the picker can be scrolled to in CupertinoDatePickerMode.date mode. Defaults to 1 and must not be null.
cupertinoDatePickerMaximumYearrequiredThe cupertinoDatePickerMinimumYear parameter is the minimum year that the picker can be scrolled to in CupertinoDatePickerMode.date mode. Defaults to 1 and must not be null.
cupertinoDatePickerBackgroundColorrequiredDefaults to null, which disables background painting entirely. Background color of cupertinoDatePicker.
cupertinoDatePickerKeyoptionalThe cupertinoDatePickerKey is an identifier.
cupertinoDateInitialDateTimerequiredDefaults to the present date and time and must not be null.
cupertinoDateOrderoptionalDetermines the order of the columns inside CupertinoDatePicker in date mode. Defaults to the locale's default date format/order.
textfieldDatePickerWidthoptionalGives you the option to adjust the width of the TextfieldDatePicker widget.
textfieldDatePickerMarginoptionalAllows you to add some margin to the TextfieldDatePicker
textfieldDatePickerPaddingoptionalAllows you to add some padding to the TextfieldDatePicker

TextfieldDateAndTimePicker

PropertyDefaultDescription
materialDatePickerInitialEntryModeDatePickerEntryMode.calendarIn DatePickerEntryMode.calendar mode, a calendar grid is displayed and the user taps the day they wish to select. In DatePickerEntryMode.input mode a TextField is displayed and the user types in the date they wish to select..
materialDatePickerFirstDaterequiredThe materialDatePickerFirstDate parameter is the earliest allowable date.
materialDatePickerInitialDaterequiredWhen the date picker is first displayed, it will show the month of materialDatePickerInitialDate, with materialDatePickerInitialDate selected.
materialDatePickerLastDaterequiredThe materialDatePickerLastDate parameter is the latest allowable date.
preferredDateFormatrequiredThe preferredDateFormat parameter is for formatting and parsing dates in a locale-sensitive manner.
materialDatePickerBuilderoptionalThe materialDatePickerBuilder parameter can be used to wrap the dialog widget to add inherited widgets like Theme.
materialDatePickerLocaleoptionalmaterialDatePickerLocale optional locale argument can be used to set the locale for the date picker. It defaults to the ambient locale provided by Localizations.
materialDatePickerSelectableDayPredicateoptionalAn optional materialDatePickerSelectableDayPredicate function can be passed in to only allow certain days for selection.
materialInitialTimerequiredWhen the time picker is first displayed, it will have materialInitialTime, as the time selected.
materialTimePickerUse24hrFormatoptionalDefaults to false.
materialTimePickerInitialEntryModeoptionalThe materialTimePickerInitialEntryMode parameter can be used to determine the initial time entry selection of the picker (either a clock dial or text input).
materialTimePickerBuilderoptionalThe materialTimePickerBuilder parameter can be used to wrap the dialog widget to add inherited widgets like Localizations.override, Directionality, or MediaQuery.
cupertinoDatePickerMaximumDaterequiredThe cupertinoDatePickerMaximumDate parameter is the maximum selectable date that the picker can settle on.
cupertinoDatePickerMinimumDaterequiredThe cupertinoDatePickerMinimumDate is the minimum selectable date that the picker can settle on.
cupertinoDatePickerMinimumYearoptionalThe cupertinoDatePickerMinimumYear parameter is the minimum year that the picker can be scrolled to in CupertinoDatePickerMode.date mode. Defaults to 1 and must not be null.
cupertinoDatePickerMaximumYearrequiredThe cupertinoDatePickerMinimumYear parameter is the minimum year that the picker can be scrolled to in CupertinoDatePickerMode.date mode. Defaults to 1 and must not be null.
cupertinoDatePickerBackgroundColorrequiredDefaults to null, which disables background painting entirely. Background color of cupertinoDatePicker.
cupertinoDatePickerKeyoptionalThe cupertinoDatePickerKey is an identifier.
cupertinoDateInitialDateTimerequiredDefaults to the present date and time and must not be null.
cupertinoDateOrderoptionalDetermines the order of the columns inside CupertinoDatePicker in date mode. Defaults to the locale's default date format/order.
cupertinoTimePickerUse24hFormatoptionalDefaults to false.
cupertinoTimePickerMinuteIntervaloptionalThe granularity of the minutes spinner, if it is shown in the current mode. Must be an integer factor of 60.
textfieldDateTimePickerWidthoptionalGives you the option to adjust the width of the TextfieldDateAndTimePicker widget.
textfieldDateTimePickerMarginoptionalAllows you to add some margin to the TextfieldDateAndTimePicker
textfieldDateTimePickerPaddingoptionalAllows you to add some padding to the TextfieldDateAndTimePicker

TextfieldTimePicker

PropertyDefaultDescription
materialInitialTimerequiredWhen the time picker is first displayed, it will have materialInitialTime, as the time selected.
materialTimePickerUse24hrFormatoptionalDefaults to false.
materialTimePickerInitialEntryModeoptionalThe materialTimePickerInitialEntryMode parameter can be used to determine the initial time entry selection of the picker (either a clock dial or text input).
materialTimePickerBuilderoptionalThe materialTimePickerBuilder parameter can be used to wrap the dialog widget to add inherited widgets like Localizations.override, Directionality, or MediaQuery.
cupertinoDatePickerBackgroundColorrequiredDefaults to null, which disables background painting entirely. Background color of cupertinoDatePicker.
cupertinoDatePickerKeyoptionalThe cupertinoDatePickerKey is an identifier.
cupertinoDateInitialDateTimerequiredDefaults to the present date and time and must not be null.
cupertinoTimePickerUse24hFormatoptionalDefaults to false.
cupertinoTimePickerMinuteIntervaloptionalThe granularity of the minutes spinner, if it is shown in the current mode. Must be an integer factor of 60.
textfieldTimePickerWidthoptionalGives you the option to adjust the width of the TextfieldTimePicker widget.
textfieldTimePickerMarginoptionalAllows you to add some margin to the TextfieldTimePicker
textfieldTimePickerPaddingoptionalAllows you to add some padding to the TextfieldTimePicker

Example

See the example for a complete sample app using the various widgets from textfield_datepicker

Found an issue or have a suggestion?

Create an issue

Contact

Contact me via email edinjoey@email.com