flutter_umeng_analytics 0.0.2 copy "flutter_umeng_analytics: ^0.0.2" to clipboard
flutter_umeng_analytics: ^0.0.2 copied to clipboard

Flutter Plugin for umeng:analytics (友盟统计)

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_umeng_analytics/flutter_umeng_analytics.dart';

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

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

class _MyAppState extends State<MyApp> {
  static bool _inited;
  @override
  initState() {
    super.initState();

    if (_inited == null) {
      _inited = true;
      UMengAnalytics.init('5a20cc45f43e48512000015d',
          policy: Policy.BATCH, encrypt: true, reportCrash: false);
    }
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        ),
        body: new Center(
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
            new RaisedButton(
              onPressed: () {
                UMengAnalytics.logEvent("hello");
              },
              child: new Text('Running on: hello'),
            ),
          ]),
        ),
      ),
    );
  }
}
5
likes
25
pub points
0%
popularity

Publisher

unverified uploader

Flutter Plugin for umeng:analytics (友盟统计)

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_umeng_analytics