fusionsdk 1.2.0 fusionsdk: ^1.2.0 copied to clipboard
Fusion Sdk
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:fusionsdk_example/reward_video.dart';
import 'package:fusionsdk_example/interstitial.dart';
import 'banner.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MainPage(),
routes: <String, WidgetBuilder>{
'/interstitial': (BuildContext context) => InterstitialPage(),
'/banner': (BuildContext context) => BannerPage(),
'/reward-video': (BuildContext context) => RewardVideoPage()
},
);
}
}
class MainPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
MaterialButton(
minWidth: 180,
color: Colors.blue,
textColor: Colors.white,
onPressed: () {
Navigator.of(context).pushNamed('/banner');
},
child: Text("Banner 广告")),
MaterialButton(
minWidth: 180,
color: Colors.blue,
textColor: Colors.white,
onPressed: () {
Navigator.of(context).pushNamed('/interstitial');
},
child: Text("插屏广告")),
MaterialButton(
minWidth: 180,
color: Colors.blue,
textColor: Colors.white,
onPressed: () {
Navigator.of(context).pushNamed('/reward-video');
},
child: Text("激励视频广告"))
],
),
),
);
}
}