搜索插件、代码仓与 APP 分类

插件详情v7.0.0

app_version_update

一种简单快捷的方法,用于检查本地应用是否已在各自的商店(Google Play 商店 / Apple App Store)中更新到相同版本。

AndroidiOSmacOSWindowsLinux
近 30 天下载
1.4万
喜欢数
160
Pub 分数
145

安装插件

flutter pub add app_version_update

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

app_version_update 包简化了检查已安装的应用版本是否与 Google Play 商店或 Apple App Store 上可用的最新版本匹配的过程。该包使开发者能够无需依赖第三方服务即可编程验证更新。该包支持 Android、iOS、macOS、Windows 和 Linux 等多个平台,非常适合跨平台应用。通过比较本地版本号与商店版本号,它可在必要时提示用户进行更新。

适合场景

  • 启动时检查应用更新
  • 通过应用内对话框提示用户更新
  • 验证跨平台的版本一致性
  • 在后台自动检查更新
  • 支持多平台应用

主要特点

  • 跨平台兼容性
  • 版本比较的简单 API
  • 与 Google Play 和 Apple App Store 的集成
  • 轻量且无依赖
  • 实时版本验证

适合对象

  • 跨平台 Flutter 应用
  • 需要自动更新提示的应用程序
  • 寻求最小化设置的开发者
  • 针对 Android 和 iOS 的项目
  • 需要版本同步验证的应用

使用建议

  • 需要互联网连接以进行商店查询
  • 仅限应用商店和应用市场
  • 不支持替代应用分发
  • 版本代码格式必须符合商店预期
  • 频繁检查时可能需要处理速率限制

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Star on GitHub

Retrieve version and url for local app update against store app Android and iOS

Features

Using as reference packages like in_app_update , version_check.

Compares local version with the respective store version for the purpose of detecting user-side version updates.

It also provides widgets like dialog , bottom sheets and pages for you to display the update option to the user.

Getting started

$ flutter pub add app_version_update

or add in your dependencies

dependencies:
  app_version_update: <latest>

to use this app you need to have the app hosted in stores.

To test, you can manually downgrade your pubspec.yaml from your version: , when you run your local version it will be different from the store version

Usage

Internet permission Android: <uses-permission android:name="android.permission.INTERNET" />

Internet permission iOs:

<key>NSAppTransportSecurity</key>  
<dict>  
  <key>NSAllowsArbitraryLoads</key><true/>  
</dict>  
final appleId = '284882215'; // If this value is null, its packagename will be considered
final playStoreId = 'com.facebook.katana'; // If this value is null, its packagename will be considered

await AppVersionUpdate.checkForUpdates(
            appleId: appleId, playStoreId: playStoreId)
        .then((data) async {
            print(data.storeUrl);
            print(data.storeVersion);
            if(data.canUpdate!){
              //showDialog(... your custom widgets view) 
              //or use our widgets
              // AppVersionUpdate.showAlertUpdate
              // AppVersionUpdate.showBottomSheetUpdate
              // AppVersionUpdate.showPageUpdate
              AppVersionUpdate.showAlertUpdate(
              appVersionResult: data, context: context);
            }
         });

Customize the Alert Dialog

// you also have some options to customize our Alert Dialog 
AppUpdateVersion.showAlertUpdate(
    {BuildContext? context,
      AppVersionResult? appVersionResult,
      bool? mandatory = false,
      String? title = 'New version available',
      TextStyle titleTextStyle =
          const TextStyle(fontSize: 24.0, fontWeight: FontWeight.w500),
      String? content = 'Would you like to update your application?',
      TextStyle contentTextStyle =
          const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400),
      ButtonStyle? cancelButtonStyle = const ButtonStyle(
          backgroundColor: MaterialStatePropertyAll(Colors.redAccent)),
      ButtonStyle? updateButtonStyle = const ButtonStyle(
          backgroundColor: MaterialStatePropertyAll(Colors.green)),
      String? cancelButtonText = 'UPDATE LATER',
      String? updateButtonText = 'UPDATE',
      TextStyle? cancelTextStyle = const TextStyle(color: Colors.white),
      TextStyle? updateTextStyle = const TextStyle(color: Colors.white),
      Color? backgroundColor = Colors.white})

Customize the our bottom sheet

AppUpdateVersion.showBottomSheetUpdate(
      {@required BuildContext? context,
      @required AppVersionResult? appVersionResult,
      bool? mandatory = false,
      String? title = 'New version avaible',
      Widget? content}) async {
    await showModalBottomSheet(
        isDismissible: !mandatory!,
        context: context!,
        builder: (context) => BottomSheetUpdateVersion(
              appVersionResult: appVersionResult,
              mandatory: mandatory,
              content: content,
              title: title,
            ));
  }

Customize the Page

// you also have some options to customize our Page
AppUpdateVersion.showPageUpdate(
    {@required BuildContext? context,
    @required AppVersionResult? appVersionResult,
    bool? mandatory = false,
    Widget? page}) async {
     Navigator.push(
        context!,
        MaterialPageRoute(
            builder: (context) =>
                page ??
                UpdateVersionPage(
                  mandatory: mandatory,
                  appVersionResult: appVersionResult,
                )));
  }
  
 

Additional information

Next Updates status
Mandatory or optional update released
Create TestMode development
Bottom sheet widget released
Page widget released
Handle Exceptions development
New options custom widgets released
Automatic country detection released
Modularize files listed

This project is at an initial level, more functions will be included as

So any suggestion and contribution is welcome.

所属分类

依赖

依赖清单 4 项

源码仓库

使用此插件的项目