搜尋套件、儲存庫與 APP 分類

套件詳情v7.0.0

app_version_update

一種簡單快速的方法,用於檢查本機應用程式是否已與各自商店(Play Store / Apple Store)中的版本同步更新。

AndroidiOSmacOSWindowsLinux
近 30 天下載
1.7萬
喜歡數
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 項

原始碼儲存庫

使用此套件的專案