Nailuj29
Nailuj29

Reputation: 888

Is there a CalendarView equivalent in flutter?

I'm building a flutter port of an app I made in standard Android code, and it heavily relies on a CalendarView to keep its ease of use. Is there a flutter Material widget similar to a CalendarView in Android?

Upvotes: 1

Views: 74

Answers (1)

Miguel Ruivo
Miguel Ruivo

Reputation: 17756

Yes, it does. By calling the modal showDatePicker() it will let you pick a date just like a CalendarView and return a DateTime object.

DateTime date = await showDatePicker(
              context: context,
              firstDate: firstDate,
              initialDate: initialDate,
              lastDate: lastDate,
            );

Upvotes: 1

Related Questions