ourads 0.1.1 ourads: ^0.1.1 copied to clipboard
Flutter package that helps to integrate Google Mobile Ads in a simple way with just some clicks and user can call all type of ads just by their names.
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:ourads/ourads.dart';
import 'app/routes/app_pages.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await OurAds(
iOSAdId: IOSAdId(
appOpenId: "Place here your iOS AppOpen Ad Id",
bannerId: "Place here your iOS Banner Ad Id",
interstitialId: "Place here your iOS Interstitial Ad Id",
interstitialVideoId: "Place here your iOS Interstitial Video Ad Id",
rewardedId: "Place here your iOS Rewarded Ad Id",
rewardedInterstitialId: "Place here your iOS Rewarded Interstitial Ad Id",
nativeId: "Place here your iOS Native Advanced Ad Id",
nativeAdvancedVideoId: "Place here your iOS Native Advanced Video Ad Id",
),
androidAdId: AndroidAdId(
appOpenId: "Place here your Android AppOpen Ad Id",
bannerId: "Place here your Android Banner Ad Id",
interstitialId: "Place here your Android Interstitial Ad Id",
interstitialVideoId: "Place here your Android Interstitial Video Ad Id",
rewardedId: "Place here your Android Rewarded Ad Id",
rewardedInterstitialId:
"Place here your Android Rewarded Interstitial Ad Id",
nativeId: "Place here your Android Native Ad Id",
nativeAdvancedVideoId:
"Place here your Android Native Advanced Video Ad Id",
),
).initAds(
hasOpenAd: true,
//if you make it false Open ads will not work
);
//if you want to hide Open ads from premium users you can make logic on below command.
OurAds.resumeOpenAppAds();
runApp(
ScreenUtilInit(
designSize: Size(360, 760),
builder: (_, __) => MyApp(),
),
);
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return GetMaterialApp(
title: "Application",
initialRoute: AppPages.INITIAL,
getPages: AppPages.routes,
);
}
}