ota_update 0.1.2

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

ota_update

pub package

Flutter plugin implementing OTA update.
On Android it downloads the file (with progress reporting) and triggers app installation intent.
On iOS it opens safari with specified ipa url. (only briefly tested)

Usage

To use this plugin, add ota_update as a dependency in your pubspec.yaml file.

Example

// IMPORT PACKAGE
import 'package:ota_update/ota_update.dart';

// RUN OTA UPDATE 
try {
  // START LISTENING FOR DOWNLOAD PROGRESS REPORTING EVENTS
  try {
    //LINK CONTAINS APK OF FLUTTER HELLO WORLD FROM FLUTTER SDK EXAMPLES
    OtaUpdate().execute('https://test1.4q.sk/flutter_hello_world.apk').listen(
      (OtaEvent event) {
        print('EVENT: ${event.status} : ${event.value}');
      },
    );
  } catch (e) {
    print('Failed to make OTA update. Details: $e');
  }

Statuses

  • DOWNLOADING:
    • status for events during downloading phase
    • event value is download progress percentage
  • INSTALLING:
    • event status that is sent just before triggering installation intent
    • event value is null
  • ALREADY_RUNNING_ERROR:
    • sent when 'execute' method is called before previous run finished
    • event value is null
  • PERMISSION_NOT_GRANTED_ERROR:
    • sent when user refused to grant required permissions
    • event value is null.
  • INTERNAL_ERROR:
    • sent in all other error cases
    • event value is underlying error message

TODO

  • restrict download to specific connection type (mobile, wifi)

Contribution and Support

  • Contributions are welcome!
  • If you want to contribute code please create a PR
  • If you find a bug or want a feature, please fill an issue

0.1.2

  • fixing NullPointerException when onRequestPermissionsResult was triggered by different plugin than this one

0.1.1

  • refactor to use streams only as communication channel
  • documentation changes

0.1.0

  • Initial release

example/README.md

ota_update_example

Demonstrates how to use the ota_update plugin.

Getting Started

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

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


dependencies:
  ota_update: ^0.1.2

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:ota_update/ota_update.dart';
  
Version Uploaded Documentation Archive
0.1.2 Nov 5, 2018 Go to the documentation of ota_update 0.1.2 Download ota_update 0.1.2 archive
0.1.1 Oct 29, 2018 Go to the documentation of ota_update 0.1.1 Download ota_update 0.1.1 archive
0.1.0 Oct 29, 2018 Go to the documentation of ota_update 0.1.0 Download ota_update 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
41
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

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
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8