loadNativeAd method

  1. @override
Future<List<FlutterNativeAd>> loadNativeAd({
  1. required String adId,
  2. bool isTesting = false,
  3. int adsCount = 1,
})
override

Loads one or more native ads with the specified options.

Implementation

@override
Future<List<FlutterNativeAd>> loadNativeAd({
  required String adId,
  bool isTesting = false,
  int adsCount = 1,
}) async {
  final List<dynamic>? result = await methodChannel.invokeMethod<List<dynamic>>('loadNativeAd', {
    'adId': adId,
    'isTesting': isTesting,
    'adsCount': adsCount,
  });

  if (result == null) return [];

  return result.map((e) => FlutterNativeAd.fromMap(Map<String, dynamic>.from(e as Map))).toList();
}