代码拉取完成,页面将自动刷新
import 'dart:async';
import 'package:flutter/services.dart';
export 'grown_event_type.dart';
class FlutterAdspark {
static const MethodChannel _channel = MethodChannel('flutter_adspark');
static Future<String?> get platformVersion async {
final String? version = await _channel.invokeMethod('getPlatformVersion');
return version;
}
/// 初始化
static Future<bool?> init(String appId, String channel) async {
final bool? result = await _channel.invokeMethod('init', {
"appId": appId,
"channel": channel,
});
return result;
}
/// 上报事件(系统SDK预定义+自定义)
/// [eventName] 事件名称
/// [params] 参数信息
static Future<bool?> addEvent(String eventName,
{Map<String, dynamic>? params, int type = -1}) async {
final bool? result = await _channel.invokeMethod('addEvent', {
"eventName": eventName,
"params": params,
"type": type,
});
return result;
}
/// 注册事件(系统SDK预定义)
/// [method] 注册方式
/// [isSuccess] 是否成功
static Future<bool?> registerEvent(String method, bool isSuccess) async {
final bool? result = await addEvent(
'register',
params: {
"method": method,
"is_success": isSuccess,
},
type: 1,
);
return result;
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。