upsertGroup method

  1. @override
Future<NotificationChannelGroup> upsertGroup(
  1. NotificationChannelGroup notificationChannelGroup
)
override

Implementation

@override
Future<NotificationChannelGroup> upsertGroup(
    NotificationChannelGroup notificationChannelGroup) async {
  final result = await methodChannel.invokeMethod<Map>(
    'createGroup',
    notificationChannelGroup.toJson(),
  );

  final map = Map<String, dynamic>.from(result!);
  map['channels'] = (map['channels'] as List).map((e) => Map<String, dynamic>.from(e)).toList();
  return NotificationChannelGroup.fromJson(map);
}