multi_ads 1.1.3 copy "multi_ads: ^1.1.3" to clipboard
multi_ads: ^1.1.3 copied to clipboard

Multiple Ad Network

multi_ads #

A Flutter plugin that combines ad orchestration, reward helpers, API utilities, and anime helper services in one package.

Features #

  • Screen-based and route-based ad flow helpers.
  • Banner and native ad widget helpers.
  • App registration/setup flow with remote config support.
  • Reward helper and builder utilities.
  • Clash Royale API helper methods.
  • Anime helper methods backed by your Jikan cache wrapper.

Installation #

Add to pubspec.yaml:

dependencies:
  multi_ads: ^1.1.2

Install dependencies:

flutter pub get

Import #

import 'package:multi_ads/multi_ads.dart';

Quick Start #

1) Register app and load config #

Use SetupMixin during app startup or splash flow.

class SplashController with SetupMixin {
  Future<void> init(BuildContext context) async {
    await registerApp(
      RegisterAppParameters(
        context: context,
        appVersion: '1.0.0',
        rewardType: '1',
        apiKey: ApiKey(
          androidKey: 'YOUR_ANDROID_KEY',
          iosKey: 'YOUR_IOS_KEY',
        ),
        requiredAdNetworks: const [],
        onComplete: () {
          // Continue app flow
        },
        onError: (error) {
          // Handle setup error
        },
        onUpdateLaunch: (url) {
          // Open update URL
        },
      ),
    );
  }
}

2) Show ads #

MultiAds.showAdBasedOnScreen(context);

MultiAds.showAdBasedOnName(
  context,
  route: 'home',
);

3) Render banner/native widgets #

Widget build(BuildContext context) {
  return Column(
    children: [
      MultiAds.showScreenBasedBanner(context),
      MultiAds.showScreenBasedNative(context),
    ],
  );
}

Anime Helper (Jikan via Cache Wrapper) #

AnimeServices exposes anime endpoint methods such as:

  • getAnimeById
  • getAnimeFullById
  • getAnimeCharacters
  • getAnimeEpisodes
  • getAnimeNews
  • getAnimeReviews
  • getAnimeStreaming
  • getAnimeSearch

Example:

final anime = AnimeServices();

final result = await anime.getAnimeSearch(
  q: 'Naruto',
  page: 1,
  limit: 25,
  sfw: true,
);

Request Behavior #

  • Requests are routed to: [Base Url]
  • The target path is passed as: endpoint=/anime, endpoint=/top/anime, etc.
  • Each request sends: device_public_key header from DeviceMethods().getUserToken().

Exports #

This package exports:

  • Base/AdClass.dart
  • Base/MultiAds.dart
  • Helpers/MultAdsHooks.dart
  • Widget/reward_builder.dart
  • Helpers/SetupHelper.dart
  • Helpers/ClashRoyaleApi/RoyaleApiHelper.dart
  • features/anime_feature_helpers/service/anime_services.dart
  • common_interface

Platform Support #

  • Android
  • iOS

License #

See LICENSE file in the repository (if present).