deleteGroup method

  1. @override
Future<bool> deleteGroup(
  1. AtGroup atGroup
)

takes AtGroup as an input and creates the group on success return AtGroup otherwise null

Implementation

@override
Future<bool> deleteGroup(AtGroup atGroup) async {
  if (atGroup.groupName == null) {
    throw Exception('Group name is null or empty String');
  }
  var groupId = atGroup.groupId;
  var groupName = atGroup.groupName;
  var atKey = _formKey(KeyType.group, key: groupId!);
  var result = await atClient!.delete(atKey);
  if (result) {
    var atGroupBasicInfo = AtGroupBasicInfo(groupId, groupName);
    return await _deleteFromGroupList(atGroupBasicInfo);
  }
  return result;
}