A date field component that allows users to enter and edit date.
class SingleCalendar extends StatefulWidget { const SingleCalendar({super.key}); @override State<SingleCalendar> createState() => _SingleCalendarState();} class _SingleCalendarState extends State<SingleCalendar> { final today = DateTime.now(); @override Widget build(BuildContext context) { return ShadCalendar( selected: today, fromMonth: DateTime(today.year - 1), toMonth: DateTime(today.year, 12), ); }}
class MultipleCalendar extends StatefulWidget { const MultipleCalendar({super.key}); @override State<MultipleCalendar> createState() => _MultipleCalendarState();} class _MultipleCalendarState extends State<MultipleCalendar> { final today = DateTime.now(); @override Widget build(BuildContext context) { return ShadCalendar.multiple( numberOfMonths: 2, fromMonth: DateTime(today.year), toMonth: DateTime(today.year + 1, 12), min: 5, max: 10, ); }}
class RangeCalendar extends StatelessWidget { const RangeCalendar({super.key}); @override Widget build(BuildContext context) { return const ShadCalendar.range( min: 2, max: 5, ); }}