flutter_native_admob 2.0.0+2 flutter_native_admob: ^2.0.0+2 copied to clipboard
Plugin to integrate Firebase Native Admob to Flutter application. Both iOS and Android supported
import 'package:flutter/material.dart';
import 'package:flutter_native_admob/flutter_native_admob.dart';
import 'package:flutter_native_admob/native_admob_controller.dart';
import 'package:flutter_native_admob/native_admob_options.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 _controller = NativeAdmobController();
@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,
),
Container(
height: 330,
padding: EdgeInsets.all(10),
margin: EdgeInsets.only(bottom: 20.0),
child: NativeAdmob(
adUnitID: _adUnitID,
controller: _controller,
options: NativeAdmobOptions(
ratingColor: Colors.red,
headlineTextStyle: NativeTextStyle(color: Colors.red),
bodyTextStyle: NativeTextStyle(color: Colors.red),
),
),
),
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,
),
Container(
height: 330,
padding: EdgeInsets.all(10),
margin: EdgeInsets.only(bottom: 20.0),
child: NativeAdmob(
adUnitID: _adUnitID,
controller: _controller,
),
),
],
),
),
);
}
}