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

This commit is contained in:
Darren Austin 2019-05-20 18:10:24 -07:00 committed by GitHub
parent 592f81e7c4
commit 5ba0461b6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,