v3.0.2calender_picker
水平タイムライン、単日/複数日選択、日付範囲、および広範なカスタマイズオプションを備えたモダンでカスタマイズ可能なFlutterカレンダーピッカー。
ajbaptist/CalenderPicker open-source repository details.
以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
A modern, customizable Flutter calendar picker with horizontal timeline, single/multi-date selection, date ranges, and extensive customization options for 2026 Flutter standards.
Single Date Selection |
Multiple Date Selection |
Date Range Selection |
Custom Styling |
Add to your pubspec.yaml:
dependencies:
calender_picker: ^3.0.0
import 'package:calender_picker/calender_picker.dart';
CalendarPicker(
selectionMode: CalendarSelectionMode.single,
onDateSelected: (date) {
print('Selected: $date');
},
)
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');
},
)
CalendarPicker(
selectionMode: CalendarSelectionMode.multiple,
config: const CalendarConfig(
activeDates: [DateTime(2024, 1, 15), DateTime(2024, 1, 20)],
),
onDatesSelected: (dates) {
print('Selected dates: $dates');
},
)
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');
}
},
)
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
},
)
CalendarPicker(
style: CalendarStyle.dark(),
// ... other properties
)
CalendarPicker(
style: CalendarStyle.material3(),
// ... other properties
)
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();
}
}
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(
// 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,
)
| 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 |
| 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 |
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());
}
The calendar includes comprehensive accessibility features:
Run tests:
flutter test
Run example app:
cd example
flutter run
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 | 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 |
Contributions are welcome! Please:
MIT License - see LICENSE file.
intl for internationalizationMade with ❤️ for the Flutter community
依存関係一覧 5 件
{"sdk":"flutter"}^0.19.0^1.18.0{"sdk":"flutter"}^4.0.0用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗