优化代码逻辑
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'flutter_union_ad.dart';
|
||||
|
||||
/// @Description: dart类作用描述
|
||||
@@ -9,15 +7,13 @@ const EventChannel tencentAdEventEvent =
|
||||
EventChannel("com.example.union_ad_ssgf/adevent");
|
||||
|
||||
class FlutterUnionAdStream {
|
||||
///
|
||||
/// # 注册stream监听原生返回的信息
|
||||
/// 注册stream监听原生返回的信息
|
||||
/// [rewardAdCallBack] 激励广告回调
|
||||
/// [interactionAdCallBack] 插屏广告回调
|
||||
///
|
||||
static StreamSubscription initAdStream(
|
||||
{FlutterUnionAdRewardCallBack? flutterTencentadRewardCallBack,
|
||||
FlutterUnionAdInteractionCallBack? flutterTencentadInteractionCallBack}) {
|
||||
StreamSubscription _adStream =
|
||||
StreamSubscription adStream =
|
||||
tencentAdEventEvent.receiveBroadcastStream().listen((data) {
|
||||
switch (data[FlutterUnionAdCode.adType]) {
|
||||
///激励广告
|
||||
@@ -134,7 +130,7 @@ class FlutterUnionAdStream {
|
||||
break;
|
||||
}
|
||||
});
|
||||
return _adStream;
|
||||
return adStream;
|
||||
}
|
||||
|
||||
static void deleteAdStream(StreamSubscription stream) {
|
||||
|
Reference in New Issue
Block a user