Skip to content

Instantly share code, notes, and snippets.

@webianks
Last active August 13, 2019 10:05
Show Gist options
  • Save webianks/6443eb9282c788013326396d8eebca32 to your computer and use it in GitHub Desktop.
Save webianks/6443eb9282c788013326396d8eebca32 to your computer and use it in GitHub Desktop.
showModalBottomSheet(
context: context,
builder: (context) {
return Container(
color: CupertinoColors.white,
height: MediaQuery.of(context).copyWith().size.height / 3,
child: Column(
children: <Widget>[
Align(
alignment: Alignment.topRight,
child: CupertinoButton(
onPressed: () {
Navigator.of(context).pop()
},
child: Text("Done"),
),
),
Expanded(
child: CupertinoDatePicker(
onDateTimeChanged: (DateTime picked) {
},
initialDateTime: initialDate,
mode: CupertinoDatePickerMode.date,
maximumDate: DateTime.now(),
maximumYear: DateTime.now().year,
minimumYear: 1900,),
),
],
),
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment