umeng_analytics_plugin 1.0.3 copy "umeng_analytics_plugin: ^1.0.3" to clipboard
umeng_analytics_plugin: ^1.0.3 copied to clipboard

A Umeng analytics Flutter plugin support both android and ios. Umeng is a popular App analytics product in China.

example/lib/main.dart

import 'dart:async';

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

void main() => runApp(MyApp());

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

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  Future<void> initPlatformState() async {
    var result = await UmengAnalyticsPlugin.init(
      androidKey: '5dfc5b91cb23d26df0000a90',
      iosKey: '5dfc5c034ca35748d1000c4c',
    );

    print('Umeng initialized.');

    if (!mounted) {
      return;
    }

    setState(() {
      _platformVersion = result ? 'OK' : 'ERROR';
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}
13
likes
40
points
18
downloads

Publisher

verified publisherjitao.tech

Weekly Downloads

A Umeng analytics Flutter plugin support both android and ios. Umeng is a popular App analytics product in China.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on umeng_analytics_plugin