BetterDatePickerTimeline
🎨 Why BetterDatePickerTimeline?
The better_date_picker_timeline package is an enhanced version of the date_picker_timeline package. It offers more customization options to better suit your needs.
New Features
-
AddedscrollDirection: Allows the user to specify the axis of the date picker, whether horizontal or vertical. -
Addedphysics: Adding this parameter enhances the user experience when interacting with the ListView. -
Addedpadding: Users can now add padding to the first and last elements of the ListView from the sides. -
Replaceddecoration: This parameter replacesselectionColor, allowing for more customization of the background. -
FixeddeactivatedTextColor: Fixed the naming of this parameter.
🚩 Calendar Support (Gregorian & Jalali)
With the calendarType parameter, users can switch between the default Gregorian calendar and the Jalali (Persian) calendar by setting it to CalendarType.persianDate.
🧩 How To Use
Import the following package in your dart file
import 'package:better_date_picker_timeline/date_picker_timeline.dart';
⚙️ Usage
This version is breaking backwards compatibility
Use the DatePicker Widget
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
DatePicker(
DateTime.now(),
initialSelectedDate: DateTime.now(),
selectedTextColor: Colors.white,
onDateChange: (date) {
// New date selected
setState(() {
_selectedValue = date;
});
},
),
],
)
Constructor:
DatePicker(
this.startDate, {
Key key,
this.width,
this.height,
this.controller,
this.scrollDirection = Axis.horizontal,
this.physics,
this.padding,
this.monthTextStyle,
this.dayTextStyle,
this.dateTextStyle,
this.selectedTextColor,
this.decoration,
this.deactivatedTextColor,
this.initialSelectedDate,
this.activeDates,
this.inactiveDates,
this.daysCount,
this.onDateChange,
this.locale = "en_US",
this.calendarType = CalendarType.gregorianDate,
this.directionality,
}) : super(key: key);