mzanalytics 0.2.14 copy "mzanalytics: ^0.2.14" to clipboard
mzanalytics: ^0.2.14 copied to clipboard

unlistedoutdated

A plugin for the Flutter project of iOS and Android platform based on MZAnalytics SDK.

example/lib/main.dart

import 'package:flutter/material.dart';
import "package:mzanalytics_example/main_second.dart";
import 'package:mzanalytics/mzanalytics.dart';

void main() {
  runApp(new MaterialApp(
    title: 'Navigation Basics',
    home: new FirstScreen(),
    navigatorObservers: [MZNavigationHistoryObserver()]
  ));
}

class FirstScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: new AppBar(
            title: new Text('First Screen'),
          ),
          body: new Center(
            child: Column(children: <Widget>[
              RaisedButton(
                child: new Text('存储自定义事件'),
                onPressed: () {
                  var parameter = {
                    'eventClassify': '点击热门banner',
                    'eventAction': 'Click',
                    'eventTag': '点击',
                    'cd1': 'cd1value22222222222',
                    'cm1': 'cm1value22222222222'
                  };
                  Mzanalytics.writeParams(parameter);
                },
              ),
              RaisedButton(
                child: new Text('跳转页面'),
                onPressed: () {
                  Navigator.of(context).push(MaterialPageRoute(
                      settings: RouteSettings(name: "111222333"),
                      builder: (BuildContext context) => MyApp()));
                },
              ),
              RaisedButton(
                child: new Text('进入测试页面'),
                onPressed: () {
                  // Navigator.push(
                  //   context,
                  //   new MaterialPageRoute(
                  //       builder: (context) => new SecondScreen()),
                  // );
                  Navigator.of(context).push(MaterialPageRoute(
                      settings: RouteSettings(name: "223344"),
                      builder: (BuildContext context) => SecondScreen()));
                },
              ),
            ]),
          )),
     
    );
  }
}

class SecondScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text("Second Screen"),
      ),
      body: new Center(
        child: new RaisedButton(
          onPressed: () {
            Navigator.pop(context);
          },
          child: new Text('Go back!'),
        ),
      ),
    );
  }
}
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A plugin for the Flutter project of iOS and Android platform based on MZAnalytics SDK.

Homepage

License

unknown (LICENSE)

Dependencies

built_collection, flutter, path_provider

More

Packages that depend on mzanalytics