p_umeng 0.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 57

p_umeng #

测试中

flutter & umeng

Android #

测试 #

  1. 事件记录测试通过
PUmeng.onEvent("MyEvent2", label: "MyLabel2");
  1. 页面统计不确定有没有问题

混淆规则 #

-keep class com.umeng.** {*;}
-keepclassmembers class * {
   public <init> (org.json.JSONObject);
}
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep public class [您的应用包名].R$*{
public static final int *;
}

iOS #

0.0.3 #

  • umeng onEvent pass
MobclickAgent.onEvent(mContext, eventId, label)

0.0.2 #

  • change config

0.0.1 #

  • init

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:p_umeng_example/router/router.dart';
import 'dart:async';
import 'package:p_umeng_example/router/router_config.dart';
import 'package:p_umeng_example/ui/home_page.dart';
import 'package:p_umeng_example/utils/analytics/analytics.dart';
import 'package:p_umeng_example/utils/logger.dart';

import 'utils/analytics/app_analysis.dart';

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

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

class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
  @override
  void initState() {
    WidgetsBinding.instance.addObserver(this);
    super.initState();
    Future.delayed(Duration(milliseconds: 1000), () {
      initUmeng();
    });
  }

  Future<void> initUmeng() async {
    AnalyticsUtils.init();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: RouterUtils.navigatorKey,
      title: 'P_uemng',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      routes: buildRoutes(),
      navigatorObservers: [
        AppAnalysis(),
      ],
      home: Builder(
        builder: (context) {
          return HomePage();
        },
      ),
    );
  }

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    if (state == AppLifecycleState.resumed) {
      _appResume();
    } else if (state == AppLifecycleState.paused) {
      _appPause();
    }
    super.didChangeAppLifecycleState(state);
  }

  void _appResume() {
    Logger.d(msg: "onForeground ");
  }

  void _appPause() {
    Logger.d(msg: "onBackground ");
  }

  @override
  void dispose() {
    WidgetsBinding.instance.removeObserver(this);
    super.dispose();
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  p_umeng: ^0.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:p_umeng/p_umeng.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
27
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
57
Learn more about scoring.

We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test