cs_ironsource_ad 0.0.8 copy "cs_ironsource_ad: ^0.0.8" to clipboard
cs_ironsource_ad: ^0.0.8 copied to clipboard

Ironsource adware SDK 7.2.0

example/lib/main.dart

import 'package:cs_ironsource_ad/ironsource.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import 'providers/banner_providers.dart';
import 'widgets/banner_widget.dart';
import 'widgets/button_ads.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (_) => BannerProvider()),
      ],
      child: MaterialApp(
        home: Scaffold(
          appBar: AppBar(
            centerTitle: true,
            title: const Text('Flutter IronSource  Demo'),
          ),
          body: Stack(
            children: <Widget>[
              Container(
                padding: const EdgeInsets.symmetric(vertical: 50.0),
                alignment: Alignment.center,
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: const <Widget>[
                    ButtonAdsWidget(),
                    BannerWidget(),
                  ],
                ),
              ),
              // Banner ad
              Consumer<BannerProvider>(builder: (context, bannerProv, child) {
                return bannerProv.isBannerShow
                    ? Align(
                        alignment: Alignment.bottomCenter,
                        child: IronSourceBannerAd(
                          keepAlive: true,
                          listener: BannerAdListener(),
                          size: BannerSize.BANNER,
                          // size: BannerSize.LARGE,
                          // size: BannerSize.LEADERBOARD,
                          // size: BannerSize.RECTANGLE,
                          // size: BannerSize.SMART,
                          /* size: BannerSize(
                          type: BannerSizeType.BANNER,
                          width: 400,
                          height: 50,
                        ), */
                          // backgroundColor: Colors.amber,
                        ),
                      )
                    : const SizedBox();
              }),
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
115
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

Ironsource adware SDK 7.2.0

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on cs_ironsource_ad