Flutter

Example App


Initialize Adrop

  1. Import the Adrop

  2. Initialize the Adrop early in the project’s run-time lifecycle, preferably at launch.

import 'package:adrop_ads_flutter/adrop_ads_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initialize();
  }

  Future<void> initialize() async {
    // true for production
    await Adrop.initialize(false);
  }
}

When production is false, you can check error logs.

Display ad units

Last updated