Fixed several issues with the confirmDismiss handling on the LeaveBehindItem demo. (#33080)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user