deleteDialog method

Future<void> deleteDialog(
  1. BuildContext context,
  2. List<VEntity> entities
)

Implementation

Future<void> deleteDialog(
    BuildContext context, List<VEntity> entities) async {
  List<VEntity> all = await getAllChildren(entities).toList();
  await DialogConfirm(
      title: all.length == 1
          ? "Delete ${all.first.name}?"
          : "Delete ${all.length} Items",
      destructive: true,
      confirmText: "Delete",
      description: all.length == 1
          ? "Are you sure you want to delete ${all.first.name}?"
          : "Are you sure you want to delete ${all.whereType<VFile>().length} files and ${all.whereType<VFolder>().length} folders?",
      onConfirm: () => deleteAll(all)).open(context);
}