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 { ...@@ -230,20 +230,16 @@ class _LeaveBehindListItem extends StatelessWidget {
confirmDismiss: !confirmDismiss ? null : (DismissDirection dismissDirection) async { confirmDismiss: !confirmDismiss ? null : (DismissDirection dismissDirection) async {
switch(dismissDirection) { switch(dismissDirection) {
case DismissDirection.endToStart: case DismissDirection.endToStart:
if (await _showConfirmationDialog(context, 'archive')) return await _showConfirmationDialog(context, 'archive') == true;
_handleArchive();
break;
case DismissDirection.startToEnd: case DismissDirection.startToEnd:
if (await _showConfirmationDialog(context, 'delete')) return await _showConfirmationDialog(context, 'delete') == true;
_handleDelete();
break;
case DismissDirection.horizontal: case DismissDirection.horizontal:
case DismissDirection.vertical: case DismissDirection.vertical:
case DismissDirection.up: case DismissDirection.up:
case DismissDirection.down: case DismissDirection.down:
assert(false); assert(false);
} }
return true; return false;
}, },
background: Container( background: Container(
color: theme.primaryColor, 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