flutter_update 1.0.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new55

flutter_update

To update your app to newest version. Only Support Android Device for now.

Getting Started

You have to download the newest app to your device, then call FlutterUpdate to install it by using the file path. You can use it like this.

import 'package:flutter_update/flutter_update.dart';
void main(){
    FlutterUpdate.install(YourAppHomeUrl,YourLocalApkFilePath);
}

Future Work

Maybe I will add function download to this lib,for more easiler use. For now, I want the coder download by self,for coder to make some custom tip or festures.

Partner Wanted

I am good at Android,but know less about ios. If you want make it support IOS devices, Just email to me, or take an issue. (New Issue)[https://github.com/YunlongYang/flutter_update/issues/new]

1.0.0

  • args change to (String appHomeUrl,String filePath),for future support IOS devices.

0.0.1

  • Make it work on Android.

example/README.md

flutter_update_example

You have to download the newest app to your device, then call me to install it by using the file path.

About Android FileProvider

  • For safe,Android use FileProvider to share files between diffenrent apps.
  • You can change the default FileProvider authorities by this way.
  • There are two places that you should replace. Just find all "your.auth",and replace to yours.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.github.yyl.update.flutterupdateexample" 
    xmlns:tools="http://schemas.android.com/tools">
     <meta-data android:name="FILE_PROVIDER_AUTHORITIES" tools:replace="android:value" android:value="your.auth"/>

        <provider android:name="android.support.v4.content.FileProvider" tools:replace="android:authorities" android:authorities="your.auth" android:exported="false" android:grantUriPermissions="true">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
        </provider>

    </application>
</manifest>

Tips

You must add this attr "xmlns:tools" to node manifest.

<manifest xmlns:tools="http://schemas.android.com/tools">

Getting Started

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

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

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

class _MyAppState extends State<MyApp> {

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


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('flutter_update example'),
        ),
        body: Column(
            children: <Widget>[
              Center(
                child:Text('Move one apk file to /sdcard/Android/tmp/app.apk\nThen click Install'),
              ),
              FlatButton.icon(
                icon: Icon(Icons.open_in_new),
                label: Text("Install"),
                onPressed: (){
                  FlutterUpdate.install("http://itunes.apple.com/lookup?id=yourid","/sdcard/Android/tmp/app.apk");
                },
              )
            ],
          )
        ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_update: ^1.0.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_update/flutter_update.dart';
  
Version Uploaded Documentation Archive
1.0.0 Dec 26, 2018 Go to the documentation of flutter_update 1.0.0 Download flutter_update 1.0.0 archive
0.0.1 Dec 26, 2018 Go to the documentation of flutter_update 0.0.1 Download flutter_update 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
19
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]
55
Learn more about scoring.

We analyzed this package on Jan 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.10
  • Flutter: 1.1.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Format lib/flutter_update.dart.

Run flutter format to format lib/flutter_update.dart.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8