flutter_install_referer 0.9.3

  • Readme
  • Changelog
  • Example
  • Installing
  • new50

flutter_install_referer #

This package if build for flutter to get install referer, such as channel info, install referer, downlaod time, and any other custom info.

but you need extra steps and combain this package to finish the job. I will put the steps below.

  • this package only work in android *

steps #

1. install this package #

install this package in you project, and you can get your referer data as Map in this way:

Map<String,String> refererInfo = await FlutterInstallReferer.installReferer;

as you see, the data is a Map.

2. build apk #

you can use command methods to build your project to apk file. because we will add extra data to the apk file later. such as :

 flutter build apk --split-per-abi

3. add your referer data to apk file #

now, we need a command line tool walle-cli , you can click here to see more info about this tool

frist you need downlaod this tool in here

and then the basic command is :

java -jar walle-cli-all.jar put -c sky -e buildTime=20200620,info=hello /Users/Downloads/app.apk /Users/xxx/Downloads/newAPKFilePath.apk
  • -c : channel, you can use as referer.
  • -e : extra data, you can add any other data with key=value pair.
  • /Users/Downloads/app.apk:the apk file path you build last step.
  • /Users/xxx/Downloads/newAPKFilePath.apk new apk file path.

this command will complete super fast, actually you can repack the apk file to over 100 channels in milliseconds

4. install or share the new apk file #

for test you can run adb install /Users/xxx/Downloads/newAPKFilePath.apk

and then you can get the Map data you need.

you can get something like this.

screenshot

0.9.3 #

  • fix readme

0.9.2 #

  • fix something

0.9.1 #

  • finish basic function

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:flutter_install_referer/flutter_install_referer.dart';

void main() {
  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  Map _refererInfo;

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

  Future<void> initPlatformState() async {
    Map<String,dynamic> refererInfo;
    try {
      refererInfo = await FlutterInstallReferer.installReferer;
    } on PlatformException {
      refererInfo = Map();
    }

    if (!mounted) return;

    setState(() {
      _refererInfo = refererInfo;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('flutter_install_referer'),
        ),
        body: Center(
          child: Text('Referer Info: \n$_refererInfo'),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_install_referer: ^0.9.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:flutter_install_referer/flutter_install_referer.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:flutter_install_referer/flutter_install_referer.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:flutter_install_referer/flutter_install_referer.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:flutter_install_referer/flutter_install_referer.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:flutter_install_referer/flutter_install_referer.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [flutter_install_referer] that is in a package requiring null.

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your 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.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test