Unverified Commit 5ba0461b authored by Darren Austin's avatar Darren Austin Committed by GitHub

Fixed several issues with the confirmDismiss handling on the LeaveBehindItem demo. (#33080)

parent 592f81e7
......@@ -230,20 +230,16 @@ class _LeaveBehindListItem extends StatelessWidget {
confirmDismiss: !confirmDismiss ? null : (DismissDirection dismissDirection) async {
switch(dismissDirection) {
case DismissDirection.endToStart:
if (await _showConfirmationDialog(context, 'archive'))
_handleArchive();
break;
return await _showConfirmationDialog(context, 'archive') == true;
case DismissDirection.startToEnd:
if (await _showConfirmationDialog(context, 'delete'))
_handleDelete();
break;
return await _showConfirmationDialog(context, 'delete') == true;
case DismissDirection.horizontal:
case DismissDirection.vertical:
case DismissDirection.up:
case DismissDirection.down:
assert(false);
}
return true;
return false;
},
background: Container(
color: theme.primaryColor,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment