FLUTTER ECOSYSTEM

nathanael540/admanager_web

用於在 Flutter Web 中顯示 AdManager 廣告的簡單外掛

admanager_web 專案封面
Stars
15
Forks
5
最近推送(UTC)
2025年5月4日
專案狀態
未封存
Nathanael Ferreira GitHub avatar
GITHUB User

Nathanael Ferreira ↗

Solion TecMinas Gerais, Brasil官方網站 ↗
語言DartJavaScriptHTML

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 5 項

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

AdManager Web Flutter

Simple package that allow us display ads from Ad Manager in Flutter Web. This was primarily created to display Adsense ads on Flutter Web.

Features

  • Request ad from Ad Manager Network
  • Can run Adsense ad in a Flutter Web App

Usage

Add admanager_web as a dependency in your pubspec.yaml file.

Import the packeage:

import 'package:admanager_web/admanager_web.dart';

Initialize our plugin to load all JS things (Need be called before the first ad request):

AdManagerWeb.init();

Just add the AdBlock widget to show the ad where you like:

[...]
 AdBlock(
     size: [AdBlockSize.largeRectangle],
     adUnitId: "/6355419/Travel/Europe",
 )
[...]

Load Rewarded Ad:

[...]
 AdRewarded().load(
    adUnitId: '/22639388115/rewarded_web_example',
    onAdLoaded: (){},
 )
[...]

Show Rewarded Ad:

[...]
 AdRewarded().show(
    onAdClosed: (){},
    onGranted: (int amount){},
 );
[...]

Additional information

For more performance add the GPT.js Library directly in your head in index.html file:

<script
  async
  src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"
></script>

This package was made in order to show Google Adsense ads on Flutter Web in a simple way. Its still in its infancy, and any help to make it better and more efficient will be appreciated.

Made with ♥ from Brazil 🇧🇷

It was made in Brazil by Nathanael Ferreira.