mirror of
https://github.com/flutter/flutter
synced 2024-10-13 03:32:55 +00:00
Fixed several issues with the confirmDismiss handling on the LeaveBehindItem demo. (#33080)
This commit is contained in:
parent
592f81e7c4
commit
5ba0461b6d
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue