๐Ÿ“… LinearCalendar

A customizable, horizontally scrollable calendar widget for Flutter, built for simplicity and flexibility.


๐Ÿ“ธ Screenshots

๐Ÿ”น Default Usage

LinearCalendar(
  startDate: DateTime.now(),
  onDateChanged: (date) {
    debugPrint('Selected date: $date');
  },
)

Linear Calendar Screenshot


๐Ÿ”ธ Customized Style

LinearCalendar(
  startDate: DateTime(2025, 5, 15),
  selectedColor: Colors.deepPurple,
  unselectedColor: Colors.grey,
  foregroundColor: Colors.white,
  onDateChanged: (date) {
    debugPrint('Selected date: $date');
  },
)

Linear Calendar Screenshot 2



โœจ Features

  • Horizontal scrolling calendar view
  • Highlights today's date
  • Customizable selection color
  • Callback on date selection
  • Lightweight and easy to integrate

๐Ÿš€ Installation

Add the package to your pubspec.yaml:

dependencies:
  flutter_linear_calendar: ^1.0.1

Then run:

flutter pub get

๐Ÿงฉ Parameters

Property Type Required Description
startDate DateTime โœ… Start of the calendar range
endDate DateTime? โŒ End of the calendar range (defaults to 30 days ahead)
onDateChanged ValueChanged<DateTime> โœ… Called when a date is selected
selectedColor Color? โŒ Background color for the selected date
unselectedColor Color? โŒ Background color for unselected dates
foregroundColor Color? โŒ Text color for the dates
scrollController ScrollController? โŒ Custom scroll controller for the calendar

๐Ÿงช Example

LinearCalendar(
  startDate: DateTime.now().subtract(Duration(days: 15)),
  endDate: DateTime.now().add(Duration(days: 30)),
  selectedColor: Colors.blueAccent,
  unselectedColor: Colors.grey[200],
  foregroundColor: Colors.black,
  onDateChanged: (date) => debugPrint("Date tapped: $date"),
)

๐Ÿ”– License

MIT


๐Ÿ‘ค Author

Developed by PearlGrell