cs_ironsource_ad 0.0.8 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();
}),
],
),
),
),
);
}
}