adpluginx 0.2.5 copy "adpluginx: ^0.2.5" to clipboard
adpluginx: ^0.2.5 copied to clipboard

unlisted

Ads Management Tool For Flutter

example/lib/main.dart

import 'package:adpluginx/adpluginx.dart';
import 'package:adpluginx_example/Screens/home.dart';
import 'package:adpluginx_example/Screens/splash_screen.dart';
import 'package:flutter/material.dart';
import './Route/router.dart' as r;

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    MaterialApp(
      home: SplashScreen(),
      title: "Spin",
    ).applyPlugin(jsonUrl: [],);
    return AdMaterialApp(
      initAdNetworks: true,
      onInitComplete: (ctx, mainJson) {
        "splashScreen".performAction(
          context: ctx,
          onComplete: () {
            Navigator.pushReplacementNamed(ctx, Home.route);
          },
        );
      },
      splashScreen: SplashScreen(),
      forceTest: false,
      jsonUrl: ["http://miracocopepsi.com/test.json"],
      routeBuilder: r.Router.onGenerateRoute,
      title: "Spin",
    );
  }
}