getSelectedMedia method Null safety

Future<List<MediaData>?> getSelectedMedia()

Implementation

Future<List<MediaData>?> getSelectedMedia() async {
  List<MediaData>? result;
  List<dynamic>? raw = await channel.invokeMethod('getSelectedMedia', null);

  if (raw != null) {
    result = raw.map((map) {
      return MediaData.fromJson(map);
    }).toList();
  }
  return result;
}