yic_attribution_plugin 0.0.2+10
yic_attribution_plugin: ^0.0.2+10 copied to clipboard
内部使用归因插件
example/lib/main.dart
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:yic_attribution_plugin/yic_attribution_plugin.dart';
import 'gdt_attribution_util.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _message = 'Hello';
@override
void initState() {
super.initState();
initPlatformState();
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {
await Future<void>.delayed(const Duration(milliseconds: 10));
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Plugin example app')),
body: Center(
child: InkWell(
onTap: () {
setState(() {
GdtAttributionUtil.gdtStart();
_message = 'World!';
});
},
child: Text(_message),
),
),
),
);
}
}