Skip to content

Commit

Permalink
API优化
Browse files Browse the repository at this point in the history
  • Loading branch information
gstory0404 committed Aug 13, 2021
1 parent 407f59d commit 8ab289f
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 55 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@

## 0.0.5

* TODO: 1、优化API

## 0.0.6

* TODO: 1、优化API
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 腾讯优量汇广告 Flutter版本

<p>
<a href="https://pub.flutter-io.cn/packages/flutter_tencentad"><img src=https://img.shields.io/badge/flutter_tencentad-v0.0.5-success></a>
<a href="https://pub.flutter-io.cn/packages/flutter_tencentad"><img src=https://img.shields.io/badge/flutter_tencentad-v0.0.6-success></a>
</p>

## 简介
Expand All @@ -28,7 +28,7 @@ flutter_tencentad是一款集成了腾讯优量汇广告Android和iOSSDK的Flutt
## 集成步骤
#### 1、pubspec.yaml
```Dart
flutter_tencentad: ^0.0.5
flutter_tencentad: ^0.0.6
```
引入
```Dart
Expand Down
3 changes: 2 additions & 1 deletion lib/flutter_tencentad.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
export 'flutter_tencentad_stream.dart';
export 'flutter_tencentad_code.dart.dart';

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_tencentad/banner/banner_ad_view.dart';
import 'package:flutter_tencentad/splash/splash_ad_view.dart';
import 'flutter_tencentad_code.dart.dart';

import 'express/express_ad_view.dart';

part 'flutter_tencentad_callback.dart';

part 'flutter_tencentad_code.dart.dart';

class FlutterTencentad {
static const MethodChannel _channel =
Expand Down
94 changes: 47 additions & 47 deletions lib/flutter_tencentad_callback.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,82 +5,82 @@ part of 'flutter_tencentad.dart';
/// @Description: dart类作用描述
///显示
typedef OnShow = void Function();
typedef TOnShow = void Function();

///曝光
typedef OnExpose = void Function();
typedef TOnExpose = void Function();

///失败
typedef OnFail = void Function(int code, dynamic message);
typedef TOnFail = void Function(int code, dynamic message);

///点击
typedef OnClick = void Function();
typedef TOnClick = void Function();

///视频播放
typedef OnVideoPlay = void Function();
typedef TOnVideoPlay = void Function();

///视频暂停
typedef OnVideoPause = void Function();
typedef TOnVideoPause = void Function();

///视频播放结束
typedef OnVideoStop = void Function();
typedef TOnVideoStop = void Function();

///跳过
typedef OnSkip = void Function();
typedef TOnSkip = void Function();

///倒计时结束
typedef OnFinish = void Function();
typedef TOnFinish = void Function();

///加载超时
typedef OnTimeOut = void Function();
typedef TOnTimeOut = void Function();

///关闭
typedef OnClose = void Function();
typedef TOnClose = void Function();

///广告预加载完成
typedef OnReady = void Function();
typedef TOnReady = void Function();

///广告预加载未完成
typedef OnUnReady = void Function();
typedef TOnUnReady = void Function();

///广告奖励验证
typedef OnVerify = void Function(String transId);
typedef TOnVerify = void Function(String transId);

///倒计时
typedef OnADTick = void Function(int time);
typedef TOnADTick = void Function(int time);

///banner广告回调
class FlutterTencentadBannerCallBack {
OnShow? onShow;
OnFail? onFail;
OnClick? onClick;
OnExpose? onExpose;
OnClose? onClose;
TOnShow? onShow;
TOnFail? onFail;
TOnClick? onClick;
TOnExpose? onExpose;
TOnClose? onClose;

FlutterTencentadBannerCallBack(
{this.onShow, this.onFail, this.onClick, this.onExpose, this.onClose});
}

///动态信息流/横幅/视频贴片广告回调
class FlutterTencentadExpressCallBack {
OnShow? onShow;
OnFail? onFail;
OnClick? onClick;
OnExpose? onExpose;
OnClose? onClose;
TOnShow? onShow;
TOnFail? onFail;
TOnClick? onClick;
TOnExpose? onExpose;
TOnClose? onClose;

FlutterTencentadExpressCallBack(
{this.onShow, this.onFail, this.onClick, this.onExpose, this.onClose});
}

///开屏广告回调
class FlutterTencentadSplashCallBack {
OnClose? onClose;
OnShow? onShow;
OnFail? onFail;
OnClick? onClick;
OnExpose? onExpose;
OnADTick? onADTick;
TOnClose? onClose;
TOnShow? onShow;
TOnFail? onFail;
TOnClick? onClick;
TOnExpose? onExpose;
TOnADTick? onADTick;

FlutterTencentadSplashCallBack(
{this.onShow,
Expand All @@ -93,13 +93,13 @@ class FlutterTencentadSplashCallBack {

///插屏广告回调
class FlutterTencentadInteractionCallBack {
OnShow? onShow;
OnClick? onClick;
OnClose? onClose;
OnFail? onFail;
OnReady? onReady;
OnUnReady? onUnReady;
OnExpose? onExpose;
TOnShow? onShow;
TOnClick? onClick;
TOnClose? onClose;
TOnFail? onFail;
TOnReady? onReady;
TOnUnReady? onUnReady;
TOnExpose? onExpose;

FlutterTencentadInteractionCallBack(
{this.onShow,
Expand All @@ -113,15 +113,15 @@ class FlutterTencentadInteractionCallBack {

///激励广告回调
class FlutterTencentadRewardCallBack {
OnShow? onShow;
OnClose? onClose;
OnExpose? onExpose;
OnFail? onFail;
OnClick? onClick;
OnVerify? onVerify;
OnReady? onReady;
OnFinish? onFinish;
OnUnReady? onUnReady;
TOnShow? onShow;
TOnClose? onClose;
TOnExpose? onExpose;
TOnFail? onFail;
TOnClick? onClick;
TOnVerify? onVerify;
TOnReady? onReady;
TOnFinish? onFinish;
TOnUnReady? onUnReady;

FlutterTencentadRewardCallBack(
{this.onShow,
Expand Down
2 changes: 0 additions & 2 deletions lib/flutter_tencentad_code.dart.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
part of 'flutter_tencentad.dart';


/// 描述:
/// @author guozi
Expand Down
4 changes: 2 additions & 2 deletions lib/flutter_tencentad_stream.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'flutter_tencentad.dart';
/// @CreateDate: 2021/8/9 9:30 下午
/// @Description: dart类作用描述
const EventChannel adEventEvent =
const EventChannel tencentAdEventEvent =
EventChannel("com.gstory.flutter_tencentad/adevent");

class FlutterTencentAdStream {
Expand All @@ -23,7 +23,7 @@ class FlutterTencentAdStream {
{FlutterTencentadRewardCallBack? flutterTencentadRewardCallBack,
FlutterTencentadInteractionCallBack? flutterTencentadInteractionCallBack}) {
StreamSubscription _adStream =
adEventEvent.receiveBroadcastStream().listen((data) {
tencentAdEventEvent.receiveBroadcastStream().listen((data) {
switch (data[FlutterTencentadType.adType]) {

///激励广告
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_tencentad
description: A flutter plugin for TencentAD.It is convenient for Android and IOS to directly call the method and native view of advertisement SDK.
version: 0.0.5
version: 0.0.6
homepage: https://github.com/gstory0404/flutter_tencentad

environment:
Expand Down

0 comments on commit 8ab289f

Please sign in to comment.