upsertGroups method

Implementation

@override
Future<List<NotificationChannelGroup>> upsertGroups(List<NotificationChannelGroup> groups) async {
  var result = await methodChannel.invokeMethod<List>(
        'createGroups',
        groups.map((group) => group.toJson()).toList(),
      ) ??
      [];
  result = result.map((e) => Map<String, dynamic>.from(e)).toList();
  for (var json in result) {
    json['channels'] =
        (json['channels'] as List).map((e) => Map<String, dynamic>.from(e)).toList();
  }
  return result.map((json) => NotificationChannelGroup.fromJson(json)).toList();
}