パッケージ、リポジトリ、アプリカテゴリを検索

GitHub リポジトリmatifdeveloper/fan_easy

fan_easy

FanEasy は、使いやすいメソッドを備えた、Facebook Audience Network 広告とのシームレスな統合が可能なシンプルなFlutterパッケージです。

fan_easy のプロジェクト画像
スター
0
フォーク
0
最終プッシュ(UTC)
2025/03/08
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

FanEasy

FanEasy is a simple and efficient Flutter package for integrating Facebook Audience Network ads seamlessly. It provides easy-to-use methods for loading and displaying various ad formats.

Features

  • Load and show Interstitial Ads
  • Load and show Rewarded Ads
  • Display Banner Ads
  • Display Native Ads
  • Check if ads are loaded

Installation

Add this to your pubspec.yaml file:

dependencies:
  fan_easy: any

Then run:

flutter pub get

Usage

Initialization

Before using any ad feature, initialize the SDK:

import 'package:fan_easy/fan_easy.dart';

void main() {
  FanEasy.instance.loadInit(testingId: "YOUR_TESTING_ID");
}
Load and Show Interstitial Ads
FanEasy.instance.loadInterstitial(placementId: "YOUR_INTERSTITIAL_PLACEMENT_ID");

if (FanEasy.instance.interstitialLoaded) {
  FanEasy.instance.showInterstitial();
}
Load and Show Rewarded Ads
FanEasy.instance.loadRewarded(placementId: "YOUR_REWARDED_PLACEMENT_ID");

if (FanEasy.instance.rewardedLoaded) {
  FanEasy.instance.showRewarded();
}
Display Banner Ads
FanEasy.instance.bannerAd(placementId: "YOUR_BANNER_PLACEMENT_ID")
Display Native Ads
FanEasy.instance.nativeAd(placementId: "YOUR_NATIVE_PLACEMENT_ID")

Example

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

void main() {
  runApp(MyApp());
  FanEasy.instance.loadInit(testingId: "YOUR_TESTING_ID");
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text("FanEasy Example")),
        body: AdExamplePage(),
      ),
    );
  }
}

class AdExamplePage extends StatefulWidget {
  @override
  _AdExamplePageState createState() => _AdExamplePageState();
}

class _AdExamplePageState extends State<AdExamplePage> {
  @override
  void initState() {
    super.initState();
    FanEasy.instance.loadInterstitial(placementId: "YOUR_INTERSTITIAL_PLACEMENT_ID");
    FanEasy.instance.loadRewarded(placementId: "YOUR_REWARDED_PLACEMENT_ID");
  }

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          ElevatedButton(
            onPressed: () => FanEasy.instance.showInterstitial(),
            child: Text("Show Interstitial Ad"),
          ),
          ElevatedButton(
            onPressed: () => FanEasy.instance.showRewarded(),
            child: Text("Show Rewarded Ad"),
          ),
          SizedBox(height: 20),
          FanEasy.instance.bannerAd(placementId: "YOUR_BANNER_PLACEMENT_ID"),
          SizedBox(height: 20),
          FanEasy.instance.nativeAd(placementId: "YOUR_NATIVE_PLACEMENT_ID"),
        ],
      ),
    );
  }
}

License

This package is licensed under the MIT License.

Muhammad Atif GitHub avatar
GitHub 作者

Muhammad Atif ↗

Flutter Developer || Android Developer || iOS Developer || Kotlin Native || Core PHP || SQL || App Publisher || Software Engineer || Google Ads || MVVM || MVC

Gamican Pvt Ltd.Mohallah Janas khel, Village Urmar Payan, Peshawar
言語Dart

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 4 件

  • flutter{"sdk":"flutter"}
  • easy_audience_network^0.0.7
  • flutter_test開発用{"sdk":"flutter"}
  • flutter_lints開発用^5.0.0

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗