A customizable and animated grid calendar widget for Flutter applications.
- Customizable primary and secondary colors
- Animated month transitions
- Month and year picker
- Today button for quick navigation
- Displays selected date
- Supports initial date selection
- Callback for date selection
Add flutter_grid_calendar to your pubspec.yaml file:
dependencies:
flutter_grid_calendar: ^1.0.0Import the package in your Dart code:
import 'package:flutter_grid_calendar/flutter_grid_calendar.dart';Here's a simple example of how to use the CalendarWidget:
CalendarWidget(
onDateSelected: (selectedDate) {
print('Selected date: $selectedDate');
},
initialDate: DateTime.now(),
primaryColor: Colors.blue,
secondaryColor: Colors.orange,
)You can customize the appearance of the calendar by modifying the following properties:
primaryColor: The main color used for the calendar header and selected date.secondaryColor: The color used to highlight today's date.initialDate: The date to initially select when the calendar is first displayed.
The onDateSelected callback is triggered when a user selects a date. It provides the selected DateTime object:
CalendarWidget(
onDateSelected: (selectedDate) {
// Do something with the selected date
},
)For a complete example, check out the example folder in the GitHub repository.
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please file an issue on the GitHub repository.
This project is licensed under the MIT License - see the LICENSE file for details.
