native_flutter_admob 0.2.0 copy "native_flutter_admob: ^0.2.0" to clipboard
native_flutter_admob: ^0.2.0 copied to clipboard

The Native Flutter Admob is a Plugin to integrate Firebase Native Admob for a Flutter application.

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

 static const adUnitID = "ca-app-pub-3940256099942544/8135179316";

  final _nativeAdmob = NativeAdmob();

  @override
  void initState() {
    super.initState();

    _nativeAdmob.initialize(appID: "ca-app-pub-3940256099942544~3347511713");
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: ListView(
          children: <Widget>[
            Container(
              margin: EdgeInsets.only(bottom: 20.0),
              height: 200.0,
              color: Colors.green,
            ),
            Container(
              margin: EdgeInsets.only(bottom: 20.0),
              height: 200.0,
              color: Colors.green,
            ),
            Container(
              margin: EdgeInsets.only(bottom: 20.0),
              height: 200.0,
              color: Colors.green,
            ),
            NativeAdmobBannerView(
              adUnitID: adUnitID,
              style: BannerStyle.dark,
              showMedia: true,
              contentPadding: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 0.0),
            ),
            Container(
              margin: EdgeInsets.only(bottom: 20.0),
              height: 200.0,
              color: Colors.green,
            ),
            Container(
              margin: EdgeInsets.only(bottom: 20.0),
              height: 200.0,
              color: Colors.green,
            ),
            Container(
              margin: EdgeInsets.only(bottom: 20.0),
              height: 200.0,
              color: Colors.green,
            ),
          ],
        ),
      ),
    );
  }
}
14
likes
25
pub points
0%
popularity

Publisher

unverified uploader

The Native Flutter Admob is a Plugin to integrate Firebase Native Admob for a Flutter application.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on native_flutter_admob