create method
Creates a new contact group.
account - Optional account. If null, uses the default account, falling
back to a local, device-only group when there is no default — which is the
case on Android 12 and below, where the platform exposes none. A local
group only accepts contacts that are themselves local.
Returns the created group with its assigned ID.
Implementation
Future<Group> create(String name, {Account? account}) async {
final result = await _channel.invokeMethod<Map>('groups.create', {
'name': name,
if (account != null) 'account': account.toJson(),
});
return JsonHelpers.decode(result, Group.fromJson)!;
}