Flutter Grid Calendar
A customizable and animated grid calendar widget for Flutter applications.
Features
- 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
Installation
Add flutter_grid_calendar to your pubspec.yaml file:
dependencies:
flutter_grid_calendar: ^1.0.0
Import the package in your Dart code:
import 'package:flutter_grid_calendar/flutter_grid_calendar.dart';
Usage
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,
)
Customization
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.
Callback
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
},
)
Example
For a complete example, check out the example folder in the GitHub repository.
Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please file an issue on the GitHub repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.