android_webview 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 65

android_webview #

A new flutter plugin project.

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

1.0.0 #

重大修改,多线程下载,监听安装状态等 ,会和之前版本冲突。

0.1.6 #

  • bug fix.

0.1.5 #

  • remove unused g service.

0.1.4 #

  • fix open picture bug

0.1.3 #

  • REMOVE AF

0.1.2 #

  • AES

0.1.1 #

0.1.0 #

  • download apk progress

0.0.7 #

  • download apk progress

0.0.6 #

  • delete unused code.

0.0.5 #

  • install referrer

0.0.4 #

  • bug fix.

0.0.3 #

  • translation

0.0.2 #

0.0.1 #

example/lib/main.dart

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

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

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

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

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';
  static const EventChannel eventChannel = const EventChannel("com.wttec.android_webview/event");

  @override
  void initState() {
    super.initState();
    initPlatformState();
    initCallback();
    eventChannel.receiveBroadcastStream().listen((obj) {
      print("event:$obj");
    });
  }


  void initCallback() {
    AndroidWebview.setHandler((MethodCall method) async {
      print("$method");
      return "";
    });
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      platformVersion = await AndroidWebview.platformVersion;
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          children: <Widget>[
            Padding(
              padding: EdgeInsets.all(30),
              child: GestureDetector(
                onTap: () async {
                  var mobile = await AndroidWebview.loginMap;
                  print("mobile:$mobile");
                },
                child: Container(
                  height: 44,
                  width: 100,
                  child: Center(
                    child: Text("login"),
                  ),
                ),
              ),
            ),
            Padding(
              padding: EdgeInsets.all(30),
              child: GestureDetector(
                onTap: () async {

                },
                child: Container(
                  height: 44,
                  width: 100,
                  color: Colors.lightBlue,
                  child: Center(
                    child: Text("toke"),
                  ),
                ),
              ),
            ),
            Padding(
              padding: EdgeInsets.all(30),
              child: GestureDetector(
                onTap: () async {

                },
                child: Container(
                  height: 44,
                  width: 100,
                  color: Colors.lightBlue,
                  child: Center(
                    child: Text("下载"),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  android_webview: ^1.0.0

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

We analyzed this package on Jul 2, 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:android_webview/android_webview.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

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

Package does not support Flutter platform web

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

Package does not support Flutter platform windows

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

Package not compatible with SDK dart

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

Health issues and suggestions

Document public APIs. (-1 points)

22 out of 22 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.

Format lib/android_webview.dart.

Run flutter format to format lib/android_webview.dart.

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.

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
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test