Multi-language support for month and weekday names.
Add reservations spanning multiple dates.
Customizable styles for dates, weekdays, and reservations.
Support for event handling like taps and long presses on dates.
📖 Usage
Basic Example:
/// Use [CalendarPageViewer] if you want to show only one month at a time./// with no tab bar.////// Use [CalendarListViewer] if you want to show all months at a time./// with a scrollable list.CalendarTabBarViewer(
initialDate: DateTime.now(),
months: ['Jan', 'Feb', ...], // List of 12 months
weekdays: ['Mon', 'Tue', ...], // List of 7 weekdays
outsideDateConfig: CalendarDateConfig(
decoration: BoxDecoration(
color: Colors.black12,
border: Border.all(color: Colors.black12, width: 0.5),
),
),
);
Advanced Configuration:
/// Use [CalendarPageViewer] if you want to show only one month at a time./// with no tab bar.////// Use [CalendarListViewer] if you want to show all months at a time./// with a scrollable list.CalendarTabBarViewer(
key: Key(_selectedDate.toString()),
initialDate: _selectedDate,
months: ['January', 'February', ...],
weekdays: ['Monday', 'Tuesday', ...],
dateConfigBuilder: (date) {
if (date.isAtSameMomentAs(DateTime(_now.year, _now.month, _now.day))) {
returnCalendarDateConfig(
decoration: BoxDecoration(
color: Colors.teal.withValues(alpha: .6),
borderRadius: BorderRadius.circular(5),
),
);
} elseif(date.isAtSameMomentAs(_selectedDate)) {
returnCalendarDateConfig(
decoration: BoxDecoration(
color: Colors.blue.withValues(alpha: .6),
borderRadius: BorderRadius.circular(5),
),
);
}
returnnull;
},
reservations: [
CalendarViewerReservation(
from: DateTime(2023, 10, 9),
to: DateTime(2023, 10, 13),
user: constCalendarReservationUser(
name: 'Mohammad Alamoudi',
netImage:
'https://cdn-icons-png.flaticon.com/512/9203/9203764.png',
),
),
],
reservation: CalenderReservationConfig(
style: CalendarReservationStyle(
color: Colors.teal.withValues(alpha: .6),
),
),
outsideDateConfig: CalendarDateConfig(
decoration: BoxDecoration(
color: Colors.black12,
border: Border.all(color: Colors.black12, width: 0.5),
),
),
);