updateGroupData method

Future updateGroupData(
  1. AtGroup group,
  2. BuildContext context, {
  3. bool isDesktop = false,
  4. int? expandIndex,
})

Implementation

Future<dynamic> updateGroupData(AtGroup group, BuildContext context,
    {bool isDesktop = false, int? expandIndex}) async {
  group = removeImageFromAtGroupMembers(group);
  try {
    var result = await updateGroup(group, expandIndex: expandIndex);
    if (isDesktop) {
      return result;
    } else {
      if (result is AtGroup) {
        Navigator.of(context).pop();
      } else if (result == null) {
        CustomToast().show(TextConstants().SERVICE_ERROR, context);
      } else {
        CustomToast().show(result.toString(), context);
      }
    }
  } catch (e) {
    return e;
  }
}