flutter_adsense_web 0.0.9 copy "flutter_adsense_web: ^0.0.9" to clipboard
flutter_adsense_web: ^0.0.9 copied to clipboard

Platformweb

A Flutter web package to easily integrate Google AdSense banner ads.

flutter_adsense_web #

A Flutter Web plugin to seamlessly integrate Google AdSense banner ads into your Flutter web applications.
This package helps developers render AdSense ads using a simple widget and custom JavaScript logic.


drawing

📦 Installation #

Add the following to your pubspec.yaml:

dependencies:
  flutter_adsense_web: latest_version

⚙️ Setup #

  1. Add the GPT script in your web/index.html(in head tag) file:
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js" crossorigin="anonymous"></script>
  1. Register Gpt AdLoader in your main function:
void main() {
  // Initialize the GPT ad loader listener
  GptAdLoader().registerGptAdLoader();
  runApp(MyApp());
}


🚀 Usage #

import 'package:flutter_adsense_web/flutter_adsense.dart';

AdsenseBanner(
  adModel: AdModel(
    divId: 'flutter-banner-ad',
    slotId: '/6355419/Travel/Europe/France/Paris',
    width: 300,
    height: 250,
  ),
)

📝 Notes #

  • Only works on Flutter Web.
  • Make sure your AdSense account has the correct ad slot IDs.
  • Ensure the GPT and ad manager JS scripts are correctly included in index.html.

🤝 Contributions Welcome! #

Feel free to open issues or pull requests to improve this package.


📄 License #

MIT

1
likes
160
points
354
downloads

Publisher

verified publisherrsin.space

Weekly Downloads

A Flutter web package to easily integrate Google AdSense banner ads.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, web

More

Packages that depend on flutter_adsense_web