Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class _ShoppingCartTabState extends State<ShoppingCartTab> {
// ...
Widget _buildDateAndTimePicker(BuildContext context) { // NEW FROM HERE
return Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: const <Widget>[
Icon(
CupertinoIcons.clock,
color: CupertinoColors.lightBackgroundGray,
size: 28,
),
SizedBox(width: 6),
Text(
'Delivery time',
style: Styles.deliveryTimeLabel,
),
],
),
Text(
DateFormat.yMMMd().add_jm().format(dateTime),
style: Styles.deliveryTime,
),
],
),
Container(
height: _kDateTimePickerHeight,
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.dateAndTime,
initialDateTime: dateTime,
onDateTimeChanged: (newDateTime) {
setState(() {
dateTime = newDateTime;
});
},
),
),
],
);
} // TO HERE
SliverChildBuilderDelegate _buildSliverChildBuilderDelegate(
AppStateModel model) {
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment