getAllChannels method

  1. @override
Future<List<NotificationChannel>> getAllChannels()
override

Implementation

@override
Future<List<NotificationChannel>> getAllChannels() async {
  final result = await methodChannel.invokeMethod<List>('getChannels') ?? [];
  if (result.isEmpty) return [];

  final map = result.map((e) => Map<String, dynamic>.from(e)).toList();
  return map.map((e) => NotificationChannel.fromJson(e)).toList();
}