flutter_umeng_analytics_gf 0.0.5 copy "flutter_umeng_analytics_gf: ^0.0.5" to clipboard
flutter_umeng_analytics_gf: ^0.0.5 copied to clipboard

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

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_umeng_analytics_gf/flutter_umeng_analytics_gf.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'),
            ),
          ]),
        ),
      ),
    );
  }
}
0
likes
25
pub points
0%
popularity

Publisher

unverified uploader

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

Homepage

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_umeng_analytics_gf