Skip to content
pubscout

google_adsense

0.1.2, released 2 years ago by labs.flutter.dev

Wrapper plugin to insert Google AdSense snippets in Flutter Web apps.

WASM-readyQuiet but busy
$ flutter pub add google_adsense
Source repository

What it does

Provides APIs to initialize AdSense and display H5 Games Ads or Ad Unit widgets on web. Includes a testing callback for deterministic unit tests.

AI-written summary of version 0.1.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need Google AdSense ads in a Flutter Web project.
  • You are building a web‑based game and have beta approval for H5 Games Ads.

Skip it when

  • Targeting mobile platforms (iOS/Android).
  • You lack the required AdSense beta approval.

Strengths

  • Web‑only focus simplifies integration.
  • Supports H5 Games Ads beta feature.
  • Provides a testing callback for unit tests.

Weaknesses

  • Only works on web; no mobile support.
  • Requires beta approval; otherwise may violate policies.
  • Ad Unit widget is experimental and invitation‑only.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:flutter/material.dart';
import 'package:google_adsense/google_adsense.dart';

void main() async {
  await AdSense.initialize();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) => const MaterialApp(home: Scaffold(body: Center(child: AdUnitWidget())));
}

Alternatives

Packages that do the same job and could replace google_adsense.

Works with

Packages commonly used together with google_adsense: ones it builds on, ones built on it, and its own family.