getAll method

Future<List<Group>> getAll({
  1. List<Account>? accounts,
  2. bool withContactCount = false,
})

Gets all contact groups.

accounts - Optional list of accounts filter. If null, returns groups from all accounts. withContactCount - Whether to include the number of contacts in each group.

Implementation

Future<List<Group>> getAll({
  List<Account>? accounts,
  bool withContactCount = false,
}) async {
  final result = await _channel.invokeMethod<List>('groups.getAll', {
    if (accounts != null)
      'accounts': accounts.map((e) => e.toJson()).toList(),
    'withContactCount': withContactCount,
  });
  return JsonHelpers.decodeList(result, Group.fromJson);
}