Giter VIP home page Giter VIP logo

updater's Introduction

Version

A flutter package to check for custom in-app update.

⭐ Installing

dependencies:
    updater: ^0.0.4

⚡ Import

import 'package:updater/updater.dart';

Properties

context → BuildContext
url → String
titleText → String
contentText → String
confirmText → String
cancelText → String
elevation → double
rootNavigator → bool
allowSkip → bool
backgroundDownload → bool
callBack → Function(String, int, String, int String)
controller → UpdaterController

Json Structure

versionCode → int
versionName → String
minSupport → int
contentText → String
url → String 
{
  "versionCode":3,
  "versionName":"1.0.0",
  "contentText":"Please update your app",
  "minSupport":2,
  "url":"/*App Download Url*/"
}
versionCode:   //Specify new version code
versionName:   //specify version name
minSuppor:     //specify minimum supported version to force update
contentText:   //specify content text, if contentText is not defined in app then this will be use
url:          //App file download link

📙 How To Use

Inside pubspec.yaml file

# Specify version code using +VersionCode
version: 0.0.3+1  #Like here the VersionCode is 1
    //Controller
    UpdaterController controller = UpdaterController(
        listener: (UpdateStatus status) {
            print('Listener: $status');
        },
        progress: (current, total) {
            print('Progress: $current -- $total');
        },
        onError: (status) {
            print('Error: $status');
        },
    );

    Updater(
        context: context,
        url: 'JSON_FILE_URL',
        titleText: 'Update available',
        // backgroundDownload: false,
        // allowSkip: false,
        contentText:
            'Update your app to the latest version to enjoy new feature.',
        // allowSkip: false,
        callBack: (verName, verCode, contentText, minSupport, downloadUrl) {
          print(
              '$verName - $verCode - $contentText - $minSupport - $downloadUrl');
        },
        controller: controller,
    ).check();

updater's People

Contributors

marsadmaqsood avatar sleewok avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.