Git Product home page Git Product logo

updat's Introduction

Updat - The simple-to-use, flutter-based desktop update package

Logo

Updat is a simple-to-use reliable flutter-native updater that handles your application's updates. All you need is a place to host your files and a place to check for the latest version.

License Pub.dev Github Issues Github Wiki

Demo

demo

Installing

To get started simply type flutter pub add updat in your terminal.

๐ŸŽ‰ Done, It's that simple.

Getting Started

Integration with your app requires just a few lines of code, add the following widget wherever you want your updat widget to be:

UpdatWidget(
  currentVersion: "1.0.0",
  getLatestVersion: () async {
    // Here you should fetch the latest version. It must be semantic versioning for update detection to work properly.
    return "1.0.1";
  },
  getBinaryUrl: (latestVersion) async {
    // Here you provide the link to the binary the user should download. Make sure it is the correct one for the platform!
    return "https://github.com/latest/release/bin.exe";
  },
  // Lastly, enter your app name so we know what to call your files.
  appName: "Updat Example",
),

That should get you up and running in just a few seconds โšก๏ธ.

or use the UpdatWindowManager, and let updat handle everything on autopilot. Just place it right after your MaterialApp.

Want to learn how to integrate Updat in your app?

Integration Instructions

Configuration

Available UpdatWidget arguments

Parameter Type Value Default
currentVersion String Required. Must be a semantic version. This is the current package's version. N/A
getLatestVersion Future<String> Required. Must be a semantic version. This should request the latest version to the server N/A
getBinaryUrl Future<String> Required. This should provide the link download the binary for a certain app version. Arguments: latestVersion N/A
appNme String Required. The Application's name. It is used to name the binaries when downloading. N/A
getChangelog Future<String> This will render a plain text view of the changelog. N/A
callback void Function(UpdatStatus) A callback that is called when the UpdatStatus gets updated. N/A
getDownloadFileLocation Future<File> Choose where to download the update. N/A
updateChipBuilder Widget Function(...) Overrides the default update chip. N/A
updateDialogBuilder Widget Function(...) Overrides the default update dialog. N/A
openOnDownload bool Whether Updat should open the installer automatically once it has been downloaded. true
closeOnInstall bool Whether Updat should close the application automatically once it has been downloaded. false

Theming

Logo

Updat is extremely easy to theme. We also use updateChipBuilder and updateDialogBuilder internally to design our widgets, so you have the same customizability we do. We provide a couple of themes to get you started.

To change the theme simply add the desired theme to the builder and you're set.

Chips

  • defaultChip which is an elevatedButton that only shows when an update is available. Shown by default.

  • defaultChipWithCheckFor which is an elevatedButton that shows under all conditions, allowing to recheck for updates.

  • defaultChipWithSilentDownload which is an elevatedButton that only shows when an update is downloaded and ready to install.

  • flatChip which is an textButton that only shows when an update is available

  • flatChipWithCheckFor which is an textButton that shows under all condition, allowing to recheck for updates.

  • flatChipWithSilentDownload which is an textButton that only shows when an update is downloaded and ready to install.

  • floatingExtendedChip which is a compact version of the dialog, which is a bit bigger and grabs user's attention more easily.

  • floatingExtendedChipWithSilentDownload which is a compact version of the dialog, which is a bit bigger and grabs user's attention more easily, and only shows when the update is ready to be installed.

Dialogs

  • defaultDialog which is the default, M2 and M3 dialog that shows by default.

Advanced Usage

If you need to send additional HTTP headers when downloading a release asset, you may define your headers by setting the downloadReleaseHeaders property of UpdatGlobalOptions, you should probably do this in the main function of your code.

UpdatGlobalOptions.downloadReleaseHeaders = {
  "Authorization": "Bearer gh_pat_1234567889abcdefghijklm",
}

updat's People

Contributors

aguilaair avatar joodo avatar paulhalliday avatar v3ntus avatar wellitonklein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

updat's Issues

How to use this package with inno setup

I need help understanding how the process of updating software will work

  1. If I create an exe file - v 1.0 using inno setup, and release it to GitHub.
  2. Then update the new version and release it on GitHub with v - 2.0

Then how the download and installation process will work for a user can you help me to understand that
Thank you in advance.

Binary url downloading is not working

When I call "startUpdate" it gives me an error status "UpdatStatus.error" in the callback. but the URL is working in the browser. I'm using releases of my private repository

Fluent UI compatibility

I'm currently using the fluent_ui package (4.6.2). Is there a way to integrate UpdatWindowManager for fluent_ui users? Wrapping Fluent UI in MaterialApp works, but leads to frequent null check errors.

Thanks in advance! Your package is awesome!

Allow custom headers to be provided for `GET` methods

In my case, I wish to provide a personal access token as my artifacts are private. It does not seem like this is possible currently:

Future<File> downloadRelease(File file, String url) async {
var res = await http.get(
Uri.parse(url),
);

A proposed solution might be to provide a custom options class holding, for example, a base request headers property that can be changed by the user.

Support unzipping

If downloading an artifact from a CI/CD pipeline, for example, on Github, these artifacts are usually zipped and require extraction to execute the installer.

Tutorial suggestion

Thank you @aguilaair for all the effort you are making for the open source community,
as you have noticed, such package usage is still far from beginner friendly,
making youtube tutorial about the required steps to build and ship ( even the example app ) will be life saving for many. what do you think?

Is there any way to view detailed error?

The title.

Is there any way to view detailed error apart from the updatStatus.error?

My update is downloading then suddenly it's error. Can't figure whats going on :)

CloseOnInstall does not work

Hello! Thank you for the nice library. It looks nice so far and I still need to play around a little bit.
The CloseOnInstall function does not work when used with bool true.
I do not get any errors or exceptions, just does not do anything.

Is there any tutorial or example on how to implement an automatic restart and replace of the application?

Greetings

Improve UpdatGlobalOptions docs

There is no documentation for UpdatGlobalOptions usages to add header to access private repository for example,

please note we need to make "Accept": "application/octet-stream", header if we want to download the asset with github rest api

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.