trackingio 1.0.0 copy "trackingio: ^1.0.0" to clipboard
trackingio: ^1.0.0 copied to clipboard

trackingio flutter

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:trackingio/trackingio.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initTrackingIO();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initTrackingIO() async {
    await Trackingio.setDebuggable(true);
    await Trackingio.init("appkey", "app store");
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('TrackingIO'),
        ),
        body: Column(
          children: [
            MaterialButton(
              onPressed: () {
                Trackingio.loginSuccess("1");
              },
              child: Text("登录事件"),
            ),
            MaterialButton(
              onPressed: () {
                Trackingio.register("1");
              },
              child: Text("注册事件"),
            ),
            MaterialButton(
              onPressed: () {
                Trackingio.event("hello", {"name": "test", "number": 2.0});
              },
              child: Text("自定义时间"),
            ),
            MaterialButton(
              onPressed: () {
                Trackingio.setPayment("123", "alipay", "CNY", 1);
              },
              child: Text("付费事件"),
            )
          ],
        ),
      ),
    );
  }
}
0
likes
150
points
6
downloads

Publisher

verified publisherhaoshuo.com

Weekly Downloads

trackingio flutter

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on trackingio

Packages that implement trackingio