showHistoricalDatePicker function

Future<FlexiDate?> showHistoricalDatePicker(
  1. BuildContext context, {
  2. FlexiDate? initialValue,
})

Implementation

Future<FlexiDate?> showHistoricalDatePicker(BuildContext context,
    {FlexiDate? initialValue}) async {
  final picker = initialValue?.copy() ?? FlexiDateData.now();
  return await showCupertinoModalPopup<FlexiDate>(
      context: context,
      builder: (context) {
        return Column(
          children: [
            Expanded(child: Container()),
            Container(
              color: Colors.white,
              alignment: Alignment.centerRight,
              child: PlatformButton(
                  onPressed: () => Navigator.of(context).pop(picker),
                  child: Text(
                    SunnyIntl.of(context)!.doneLabel,
                    style: Theme.of(context).textTheme.bodyText2!.copyWith(
                        color: Theme.of(context).primaryColor,
                        fontWeight: FontWeight.w500),
                  )),
            ),
            HistoricalDatePicker(initialValue: picker)
          ],
        );
      });
}