ourads 0.0.6 copy "ourads: ^0.0.6" to clipboard
ourads: ^0.0.6 copied to clipboard

outdated

Flutter Advertisement setting

popularity likes pub points building style: effective dart Wolfiz Technologies WhatsApp Awesome Flutter Buy Me A Coffee

Languages:

English Urdu

About OurAds #

  • OurAds package helps to resolve coding issues you may incur, Minimize repetition of typing small things. package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

  • For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

  • OurAds has 3 basic principles. This means that these are the priority for all resources in the library: PRODUCTIVITY, PERFORMANCE AND ORGANIZATION.

    • PERFORMANCE: OurAds is focused on performance and minimum consumption of resources.

    • PRODUCTIVITY: OurAds uses an easy and pleasant syntax.

    • ORGANIZATION: OurAds can easily organizes your widgets and code.

In addition, to further increase your productivity, we have More Packages and the Ads Management Setting

Adding dependency #

Add Get to your pubspec.yaml file:

dependencies:
  ourads: 0.0.6

Import get in files that it will be used:

import 'package:ourads/ourads.dart';

OurAds Installation Guide #

Please follow the complete guide to use this package.

Step 1 - OurAds Initialization #

Add below code before your MaterialApp, it will automatically work with Sample Test Ids, Live/Active Ids we'll add in next step.

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await OurAds().initAds(
    hasOpenAd: true,
    //If you want to use AppOpen Adds keep it true otherwise make it false
  );
  runApp(
    GetMaterialApp(
      title: "Application",
      initialRoute: AppPages.INITIAL,
      getPages: AppPages.routes,
    ),
  );
}

Step 2 - Platform Specific Setup #

iOS - Update your Info.plist #

Update your app's ios/Runner/Info.plist file to add two keys:

  • A GADApplicationIdentifier key with a string value of your AdMob app ID (identified in the AdMob UI).
  • A SKAdNetworkItems key with Google's SKAdNetworkIdentifier value of cstr6suwn9.skadnetwork.
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>
//later on place your live Ids here
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
</array>

Android - Update AndroidManifest.xml #

  • The AdMob App ID must be included in the AndroidManifest.xml. Failure to do so will result in a crash on launch of an app.

  • Add the AdMob App ID (identified in the AdMob UI) to the app's android/app/src/main/AndroidManifest.xml file by adding a

<manifest>
<application>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
</application>
</manifest>
  • Note : We prefer to use it with GetX and ScreenUtil Flutter Package. and its example is below.

  • Just to call Widget where ever you want to in project, but make sure to import ScreenUtil file if its not working.

Examples #

Now You can easily call app anywhere in project

Now You don't need to call Ad type with its name.

 Scaffold(
appBar: AppBar(
title: Text('Banner Ads'),
centerTitle: true,
),
body: Column(
children: [
//Now you call any add just by calling their name
StandardBanner(),
//Size in dp (320Wx50H)
LargeBanner(),
//Size in dp (320Wx100H)
MediumRectangle(),
//Size in dp (320Wx250H)
],
),
);

Full-Sized Banner #

Now You don't need to type Text and its properties again and again just type. "MyText"

Scaffold(
appBar: AppBar(
title: Text('Full-Size Banner Ad'),
centerTitle: true,
),
body: Column(
children: [
//Now you call any add just by calling their name
FullSizeBanner(),
//Size in dp (468Wx60H)
],
),
);

Banner Add Sizes #

1- Widget types:

Ads Type Widget Name Size in dp (WxH)
Standard Banner StandardBanner() 320x50
Large Banner LargeBanner()Banner() 320x100
Medium Rectangle MediumBanner() 320x250
Full-Size Banner FullSizeBanner() 468x60
Leaderboard LeaderboardBanner() 728x90

Discussion #

Community channels #

Wolfiz Technologies has a highly active and helpful community. If you have questions, or would like any assistance regarding the use of this framework, please join our community channels, your question will be answered more quickly, and it will be the most suitable place. This repository is exclusive for opening issues, and requesting resources, but feel free to be part of GetX Community.

| WhatsApp | GitHub | | Get on WhatsApp | GitHub |

8
likes
0
pub points
11%
popularity

Publisher

unverified uploader

Flutter Advertisement setting

Homepage

License

unknown (LICENSE)

Dependencies

flutter, flutter_admob_app_open, get, google_mobile_ads

More

Packages that depend on ourads