updateGroup method

Future updateGroup(
  1. AtGroup group, {
  2. int? expandIndex,
})

Function to update group details

Implementation

Future<dynamic> updateGroup(AtGroup group, {int? expandIndex}) async {
  group = removeImageFromAtGroupMembers(group);
  try {
    var updatedGroup = await atContactImpl.updateGroup(group);
    if (updatedGroup is AtGroup) {
      updateGroupStreams(updatedGroup, expandIndex: expandIndex);
      return updatedGroup;
    } else {
      return 'something went wrong';
    }
  } catch (e) {
    atSignLogger.severe('error in updating group: $e');
    return e;
  }
}