adfurikun 1.8.0 copy "adfurikun: ^1.8.0" to clipboard
adfurikun: ^1.8.0 copied to clipboard

Adfurikun plugin for Flutter apps. Supports Reward, Interstitial, NativeAd, Rectangle and Banner ads.

example/lib/main.dart

import 'package:adfurikun_example/banner_sample.dart';
import 'package:adfurikun_example/interstitial_sample.dart';
import 'package:adfurikun_example/nativead_sample.dart';
import 'package:adfurikun_example/rectangle_sample.dart';
import 'package:adfurikun_example/reward_sample.dart';
import 'package:adfurikun_example/appopenad_sample.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(TopApp());
}

class TopApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Adfurikun Sample',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      initialRoute: 'top',
      routes: {
        'top': (context) => TopPage(title: 'Adfurikun Sample'),
        'appopenad': (context) => AppOpenAdPage(),
        'reward': (context) => RewardPage(),
        'interstitial': (context) => InterstitialPage(),
        'nativead': (context) => NativeAdPage(),
        'rectangle': (context) => RectanglePage(),
        'banner': (context) => BannerPage(),
      },
    );
  }
}

class TopPage extends StatefulWidget {
  TopPage({Key? key, required this.title}) : super(key: key);
  final String title;
  @override
  TopPageState createState() => TopPageState();
}

class TopPageState extends State<TopPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            FractionallySizedBox(
                widthFactor: 0.9,
                child: ElevatedButton(
                    onPressed: () => Navigator.pushNamed(context, 'appopenad'),
                    child: Text("Show AppOpenAd")
                )
            ),
            FractionallySizedBox(
                widthFactor: 0.9,
                child: ElevatedButton(
                    onPressed: () => Navigator.pushNamed(context, 'reward'),
                    child: Text("Show Reward")
                )
            ),
            FractionallySizedBox(
                widthFactor: 0.9,
                child: ElevatedButton(
                    onPressed: () => Navigator.pushNamed(context, 'interstitial'),
                    child: Text("Show Interstitial")
                )
            ),
            FractionallySizedBox(
                widthFactor: 0.9,
                child: ElevatedButton(
                    onPressed: () => Navigator.pushNamed(context, 'nativead'),
                    child: Text("Show NativeAd")
                )
            ),
            FractionallySizedBox(
                widthFactor: 0.9,
                child: ElevatedButton(
                    onPressed: () => Navigator.pushNamed(context, 'rectangle'),
                    child: Text("Show Rectangle")
                )
            ),
            FractionallySizedBox(
                widthFactor: 0.9,
                child: ElevatedButton(
                    onPressed: () => Navigator.pushNamed(context, 'banner'),
                    child: Text("Show Banner")
                )
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
130
pub points
59%
popularity

Publisher

unverified uploader

Adfurikun plugin for Flutter apps. Supports Reward, Interstitial, NativeAd, Rectangle and Banner ads.

Homepage

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on adfurikun