calender_picker 3.0.2
calender_picker: ^3.0.2 copied to clipboard
A modern, customizable Flutter calendar picker with horizontal timeline, single/multi-date selection, date ranges, and extensive customization options.
CalendarPicker #
A modern, customizable Flutter calendar picker with horizontal timeline, single/multi-date selection, date ranges, and extensive customization options for 2026 Flutter standards.
โจ Features #
- Horizontal Timeline Calendar - Smooth horizontal scrolling calendar
- Multiple Selection Modes - Single, multiple, and range date selection
- Date Restrictions - Min/Max dates, disabled dates, blackout dates
- Visual Enhancements - Today highlighting, weekend highlighting
- Infinite Scrolling - Optional infinite horizontal scrolling
- Swipe Navigation - Touch-friendly navigation
- Custom First Day of Week - Configurable week start
- Full Customization - Colors, typography, spacing, decorations
- RTL Support - Right-to-left language support
- Full Locale Support - Internationalization ready
- Accessibility - Screen reader support, keyboard navigation
- Material 3 Support - Modern design system integration
- Dark Mode - Built-in dark theme support
- Performance Optimized - Smooth scrolling, efficient rendering
๐ธ Screenshots #
Single Date Selection |
Multiple Date Selection |
Date Range Selection |
Custom Styling |
๐ Quick Start #
Installation #
Add to your pubspec.yaml:
dependencies:
calender_picker: ^3.0.0
Basic Usage #
import 'package:calender_picker/calender_picker.dart';
CalendarPicker(
selectionMode: CalendarSelectionMode.single,
onDateSelected: (date) {
print('Selected: $date');
},
)
๐ Usage Examples #
Single Date Selection #
CalendarPicker(
selectionMode: CalendarSelectionMode.single,
initialSelection: CalendarSelection.single(DateTime.now()),
config: const CalendarConfig(
locale: 'en_US',
highlightToday: true,
highlightWeekends: true,
),
onDateSelected: (date) {
print('Selected date: $date');
},
)
Multiple Date Selection #
CalendarPicker(
selectionMode: CalendarSelectionMode.multiple,
config: const CalendarConfig(
activeDates: [DateTime(2024, 1, 15), DateTime(2024, 1, 20)],
),
onDatesSelected: (dates) {
print('Selected dates: $dates');
},
)
Date Range Selection #
CalendarPicker(
selectionMode: CalendarSelectionMode.range,
config: const CalendarConfig(
minDate: DateTime(2024, 1, 1),
maxDate: DateTime(2024, 12, 31),
),
onRangeSelected: (start, end) {
if (start != null && end != null) {
print('Selected range: $start to $end');
}
},
)
Custom Styling #
CalendarPicker(
style: CalendarStyle(
selectedColor: Colors.blue,
todayColor: Colors.orange,
weekendColor: Colors.red.shade100,
selectedTextStyle: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
onDateSelected: (date) {
// Handle selection
},
)
Dark Mode #
CalendarPicker(
style: CalendarStyle.dark(),
// ... other properties
)
Material 3 #
CalendarPicker(
style: CalendarStyle.material3(),
// ... other properties
)
Using Controller #
class MyWidget extends StatefulWidget {
@override
_MyWidgetState createState() => _MyWidgetState();
}
class _MyWidgetState extends State<MyWidget> {
final CalendarController _controller = CalendarController();
@override
Widget build(BuildContext context) {
return Column(
children: [
CalendarPicker(
controller: _controller,
selectionMode: CalendarSelectionMode.multiple,
),
ElevatedButton(
onPressed: () {
_controller.clearSelection();
},
child: const Text('Clear Selection'),
),
],
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
๐จ Customization #
CalendarConfig #
CalendarConfig(
startDate: DateTime.now(),
minDate: DateTime(2024, 1, 1),
maxDate: DateTime(2024, 12, 31),
disabledDates: [DateTime(2024, 1, 15)],
activeDates: [DateTime(2024, 1, 20)],
firstDayOfWeek: 1, // Monday
locale: 'en_US',
enableInfiniteScroll: true,
daysCount: 365,
highlightToday: true,
highlightWeekends: true,
enableSwipeNavigation: true,
showMonthHeaders: true,
height: 80,
itemWidth: 60,
itemSpacing: 4,
)
CalendarStyle #
CalendarStyle(
// Colors
backgroundColor: Colors.white,
selectedColor: Colors.blue,
todayColor: Colors.orange,
weekendColor: Colors.red.shade100,
disabledColor: Colors.grey.shade300,
// Text styles
dayTextStyle: const TextStyle(fontSize: 11, fontWeight: FontWeight.w500),
dateTextStyle: const TextStyle(fontSize: 24, fontSize: FontWeight.w600),
monthTextStyle: const TextStyle(fontSize: 11, fontWeight: FontWeight.w500),
// Decorations
selectedDecoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(25),
),
// Spacing
itemPadding: const EdgeInsets.all(8),
itemBorderRadius: 25,
)
๐ง API Reference #
CalendarPicker #
| Property | Type | Description |
|---|---|---|
selectionMode |
CalendarSelectionMode |
Selection mode (single/multiple/range) |
initialSelection |
CalendarSelection? |
Initial selection state |
config |
CalendarConfig |
Calendar configuration |
style |
CalendarStyle? |
Visual styling |
controller |
CalendarController? |
Optional controller |
onDateSelected |
ValueChanged<DateTime>? |
Single date selection callback |
onDatesSelected |
ValueChanged<List<DateTime>>? |
Multiple dates selection callback |
onRangeSelected |
Function(DateTime?, DateTime?)? |
Range selection callback |
onMonthChanged |
ValueChanged<DateTime>? |
Month change callback |
onDisabledDateTap |
ValueChanged<DateTime>? |
Disabled date tap callback |
CalendarController #
| Method | Description |
|---|---|
selectDate(DateTime) |
Select a single date |
toggleDate(DateTime) |
Toggle date in multi-selection |
selectDates(List<DateTime>) |
Set multiple dates |
selectRange(DateTime?, DateTime?) |
Set date range |
clearSelection() |
Clear all selections |
dispose() |
Dispose controller |
๐ Localization #
The package supports full internationalization:
CalendarPicker(
config: const CalendarConfig(
locale: 'es_ES', // Spanish
),
)
Supported locales depend on the intl package. Make sure to initialize date formatting:
import 'package:intl/date_symbol_data_local.dart';
void main() async {
await initializeDateFormatting('es_ES', null);
runApp(MyApp());
}
โฟ Accessibility #
The calendar includes comprehensive accessibility features:
- Screen reader support with descriptive labels
- Keyboard navigation
- High contrast support
- Semantic markup
- Focus management
๐งช Testing #
Run tests:
flutter test
Run example app:
cd example
flutter run
๐ Migration Guide #
From v2.x to v3.0 #
-
Update pubspec.yaml:
dependencies: calender_picker: ^3.0.0 -
Update imports:
// Old import 'package:calender_picker/calender_picker.dart'; CalenderPicker(...) // New import 'package:calender_picker/calender_picker.dart'; CalendarPicker(...) -
Update constructor:
// Old CalenderPicker( DateTime.now(), enableMultiSelection: true, onDateChange: (date) => print(date), ) // New CalendarPicker( selectionMode: CalendarSelectionMode.multiple, onDatesSelected: (dates) => print(dates), ) -
Update styling:
// Old CalenderPicker( selectionColor: Colors.blue, selectedTextColor: Colors.white, ) // New CalendarPicker( style: const CalendarStyle( selectedColor: Colors.blue, selectedDayTextStyle: TextStyle(color: Colors.white), selectedDateTextStyle: TextStyle(color: Colors.white), ), )
๐ Version History #
| Version | Date | Highlights |
|---|---|---|
| 3.0.2 | 2026-05-11 | Version bump to 3.0.2 (3.0.1 already published); enhanced README version history with detailed entries for all releases |
| 3.0.1 | 2026-05-11 | Fixed screenshot references to use correct .jpg files; switched images to GitHub raw URLs for pub.dev display; updated GitHub URLs to correct repository |
| 3.0.0 | 2026-05-11 | Major rewrite: Modern architecture, multiple selection modes (single/multi/range), Material 3, dark mode, accessibility, RTL support, controller pattern, performance optimizations |
| 2.0.2 | 2023-12-21 | Dependencies upgraded |
| 2.0.1 | 2023-03-24 | Screenshots added |
| 2.0.0 | 2023-03-24 | Fixed date scroll issue, upgraded to Flutter 3.0 |
| 1.0.7 | 2021-11-29 | Date format fixes |
| 1.0.6 | 2021-11-27 | Date format fixes |
| 1.0.5 | 2021-11-27 | Day format issues fixed |
| 1.0.4 | 2021-11-27 | State management problems fixed |
| 1.0.3 | 2021-11-27 | Removed debug print statements |
| 1.0.2 | 2021-10-13 | Added multi-date selection listener function |
| 1.0.1 | 2021-10-08 | Screenshots added |
| 1.0.0 | 2021-10-08 | Alignment problems fixed |
| 0.0.4 | 2021-10-07 | Screenshots added |
| 0.0.3 | 2021-10-07 | Initial screenshots added |
| 0.0.2 | 2021-10-06 | Basic functionality, updated Readme, multi-select date option, removed time from selected date |
| 0.0.1 | 2021-10-05 | Initial release |
๐ค Contributing #
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
๐ License #
MIT License - see LICENSE file.
๐ Acknowledgments #
- Built with Flutter
- Uses
intlfor internationalization - Inspired by modern calendar interfaces
Made with โค๏ธ for the Flutter community
