Stack Go
Stack Go

Reputation: 23

(Flutter) Custom CupertinoDatePicker show day of week and change position?

Based on requirement, I need to use the same date picker style for the the application both IOS and Android using the CupertinoDatePicker like this:

Widget datetime() {
    return CupertinoDatePicker(
      initialDateTime: DateTime.now().subtract(Duration(days: 1)),
      onDateTimeChanged: (DateTime newdate) {
        print(newdate);
      },
      use24hFormat: true,
      maximumDate: new DateTime(2020, 12, 30),
      minimumYear: 2010,
      maximumYear: 2020,
      minuteInterval: 1,
      mode: CupertinoDatePickerMode.date,
    );
  }

However I need to custom the display of the picker to show day of the week (EEE, example Mon 21) and swap picker position to (date with day of week name, month, year) in the CupertinoDatePicker. I need to display like this: Thu 21 - Nov - 2019 (select day, select month, and select year). How to create custom cupertinodatepicker like this?

Result: Result

Expected: Expected

Upvotes: 1

Views: 2932

Answers (2)

dstacklurker
dstacklurker

Reputation: 340

Date order can also be changed natively already. Here's the documentation link. :)

Upvotes: 0

Kavin-K
Kavin-K

Reputation: 2117

I hope flutter_cupertino_date_picker package could help to achieve what you want.

You can find the package here

Upvotes: 1

Related Questions