my_ads_manager 0.0.1 copy "my_ads_manager: ^0.0.1" to clipboard
my_ads_manager: ^0.0.1 copied to clipboard

Simple ads manager package for personal use.

example/lib/main.dart

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

void main() async {
  // Default - true
  final config = AdsConfig(enabled: true);
  final adapter = GoogleAdsAdapter();
  final repo = AdsRepository(adapter, config);
  
  runApp(MyApp(adsRepo: repo));
}

class MyApp extends StatelessWidget {
  const MyApp({super.key, required this.adsRepo});

  final AdsRepository adsRepo;

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'MyAdsManager Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: Scaffold(
        appBar: AppBar(),
        body: Column(
          children: [
            BannerAdView(
              bannerControllerFuture: adsRepo.loadBanner(
                "ca-app-pub-3940256099942544/9214589741", // test banner ad id
                width: AdSizeConfig.banner.width,
                height: AdSizeConfig.banner.height,
              ),
              height: AdSizeConfig.banner.height.toDouble(),
            ),
            const SizedBox(height: 16),
            NativeAdViewWidget(
              adUnitId: "ca-app-pub-3940256099942544/2247696110", // test id
              adsRepo: adsRepo,
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
140
points
23
downloads

Publisher

verified publisherkyawzayartun.com

Weekly Downloads

Simple ads manager package for personal use.

Repository (GitHub)
View/report issues

Documentation

API reference

Funding

Consider supporting this project:

www.buymeacoffee.com

License

MIT (license)

Dependencies

flutter, google_mobile_ads

More

Packages that depend on my_ads_manager