adflow_flutter 0.1.0 copy "adflow_flutter: ^0.1.0" to clipboard
adflow_flutter: ^0.1.0 copied to clipboard

Flutter plugin for the AdFlow ad-mediation library on top of AdMob: Interstitial, App Open, Rewarded, Native, and Banner ads. Android only for now.

example/lib/main.dart

import 'dart:async';

import 'package:adflow_flutter/adflow_flutter.dart';
import 'package:flutter/material.dart';

import 'ad_placements.dart';
import 'home_screen.dart';
import 'splash_screen.dart';

late final AdPlacements placements;

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await AdFlowCore.initialize();
  placements = AdPlacements();
  await placements.appOpen.enableAutoShowOnForeground();
  // Không chờ load() xong mới runApp() - load ads chạy song song ở background, giống
  // AdFlowDemoApp.onCreate() bản Kotlin gốc.
  unawaited(placements.loadAll());
  runApp(const MyApp());
}

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

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

class _MyAppState extends State<MyApp> {
  bool _showSplash = true;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: _showSplash
          ? SplashScreen(
              placements: placements,
              onDone: () => setState(() => _showSplash = false),
            )
          : HomeScreen(placements: placements),
    );
  }
}
0
likes
0
points
103
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin for the AdFlow ad-mediation library on top of AdMob: Interstitial, App Open, Rewarded, Native, and Banner ads. Android only for now.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, meta

More

Packages that depend on adflow_flutter

Packages that implement adflow_flutter