showMyDialog function
Implementation
Future<void> showMyDialog(BuildContext context, AtGroup group) async {
return showDialog<void>(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
Uint8List? groupPicture;
if (group.groupPicture != null) {
List<int> intList = group.groupPicture.cast<int>();
groupPicture = Uint8List.fromList(intList);
}
return ConfirmationDialog(
title: '${group.displayName}',
heading: 'Are you sure you want to delete this group?',
onYesPressed: () async {
var result = await GroupService().deleteGroup(group);
if (result is bool) {
result ? Navigator.of(context).pop() : null;
} else {
CustomToast().show(TextConstants().SERVICE_ERROR, context);
}
},
image: groupPicture,
);
},
);
}