パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v2.1.2

versionarte

更新を強制し、更新インジケーターを表示し、メンテナンス中にアプリを無効化し、UIに完全な自由度を提供します。

AndroidiOSWebmacOSWindows
30日間ダウンロード
758
いいね数
173
Pub ポイント
150

パッケージをインストール

flutter pub add versionarte

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Versionarte は、開発者がアプリの更新を強制し、カスタム更新インジケーターを表示し、メンテナンス中に一時的にアプリを無効にすることができるFlutterパッケージです。更新プロンプトとメンテナンス画面のUIに対して完全なコントロールを提供し、ユーザーが常に最新バージョンを使用しているか、ダウンタイムについて認識していることを保証します。クロスプラットフォームアプリ向けに設計されており、Android、iOS、Web、macOS、Windowsでシームレスに動作します。pub add を通じて簡単に統合でき、バージョンチェックや更新中のユーザー体験において柔軟性を提供します。

用途

  • 必須アプリ更新を強制する
  • カスタム更新バナーを表示する
  • メンテナンスモード画面を表示する
  • バージョン互換性の管理
  • ダウンタイム中にユーザーのアクセスを管理する
  • プラットフォームごとに更新UIをカスタマイズする

主な機能

  • アップデート画面の完全なUIカスタマイズ
  • 複数のプラットフォームのサポート
  • 柔軟なバージョンチェックロジック
  • メンテナンスモードの強制実行
  • pub との簡単な統合
  • 設定可能な更新トリガー

適している対象

  • 厳密なバージョン管理を必要とするアプリ
  • カスタム更新UXが必要な開発者
  • クロスプラットフォームアプリケーション
  • 頻繁なリリースを管理するチーム
  • スケジュールされたメンテナンスウィンドウを持つアプリ
  • アップデート中にユーザー体験を最優先とするプロジェクト

注意事項

  • バージョンチェックの手動設定が必要です
  • UI コンポーネントは開発者によって実装されなければなりません
  • バージョン検証のためのバックエンドサポートが必要になる可能性があります
  • 更新ポリシーのないアプリには適していません
  • 限定された組み込み分析
  • 正確なバージョン追跡に依存しています

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

versionarte

Force update, show update indicator and disable the app for maintenance with total freedom over the UI.

😎 Benefits

  • ✋ Force users to update to the latest version
  • 💆🏻‍♂️ Have separate values for each platform
  • 🚧 Disable app for maintenance with custom informative text
  • 🆕 Inform users about an optional update availability
  • 🔗 Launch the App Store on iOS and Play Store on Android
Forced update New version indicator Maintenance mode

Read the How to force users to update your Flutter app article for detailed explanation.

🩵 Sponsors

🛫 Getting Started

Add the package and import it:

dependencies:
  versionarte: <latest_version>
import 'package:versionarte/versionarte.dart';

📡 Checking Version Status

Call Versionarte.check with a provider to get the app's versioning status:

// Using Firebase Remote Config (most common)
final VersionarteResult result = await Versionarte.check(
    versionarteProvider: RemoteConfigVersionarteProvider(),
);

Tip: Pass silent: true to suppress debug console logs.

Choose from three provider types based on your backend:

1. Using Firebase Remote Config

Recommended for apps already using Firebase

final VersionarteResult result = await Versionarte.check(
    versionarteProvider: RemoteConfigVersionarteProvider(),
);

Optional parameters:

  • keyName: Firebase config key (default: "versionarte")
  • initializeInternally: Set to false if your app already initializes Firebase
  • remoteConfigSettings: Custom settings if needed

See Firebase Remote Config setup guide for configuration details.

2. Using RESTful API

Recommended for apps with custom backends

final VersionarteResult result = await Versionarte.check(
    versionarteProvider: RestfulVersionarteProvider(
        url: 'https://myapi.com/getVersioning',
    ),
);

Optional parameters:

  • headers: Custom HTTP headers if needed

Note: Your RESTful endpoint must return the same JSON structure as shown in the Configuration JSON section below.

3. Using Custom VersionarteProvider

For advanced use cases with custom data sources

class MyCustomVersionarteProvider extends VersionarteProvider {
  @override
  Future<DistributionManifest> getDistributionManifest() async {
    final String result = MyCustomService.fetchVersioning();
    final Map<String, dynamic> decodedResult = jsonDecode(result);
    
    return DistributionManifest.fromJson(decodedResult);
  }
}

🎯 Handle the Status

Use the status value to determine what action to take:

if (result.status == VersionarteStatus.inactive) {
    // App is in maintenance mode
    final String message = result.getMessageForLanguage('en');

    showMaintenanceDialog(message);
} else if (result.status == VersionarteStatus.forcedUpdate) {
    // User must update to continue
    showForceUpdateDialog(
      onUpdate: () {
        Versionarte.launchDownloadUrl(result.downloadUrls);
      },
    );
} else if (result.status == VersionarteStatus.outdated) {
    // Update available but optional
    showOptionalUpdateDialog(
      onUpdate: () {
        Versionarte.launchDownloadUrl(result.downloadUrls);
      },
    );
} 

Tip: You can also show different widgets based on status. For example, when the app is outdated, you might want to show an update indicator anywhere in your app (for example in home page):

Widget build(BuildContext context) {
  return Column(
    children: [
      // other widgets   
      if (result.status == VersionarteStatus.outdated)
        // A custom widget to show "Update available"
        NewVersionAvailableIndicator(
          onUpdate: () {
            Versionarte.launchDownloadUrl(result.downloadUrls);
          }
        ),
      // other widgets
    ],
  );
}

🔗 Launching the Store

To open the appropriate store for the current platform:

await Versionarte.launchDownloadUrl(result.downloadUrls);

Note: Add "download_url" in your configuration JSON for each platform. The correct store opens automatically based on the current platform.

See the example directory for a complete sample app.

🖋️ Configuration JSON

The configuration JSON contains versioning and status information for each platform. Only configure platforms that your app supports.

{
    "android": {
        "version": {
            "minimum": "2.7.0", // Minimum required version
            "latest": "2.8.0"   // Latest available version
        },
        "download_url": "https://play.google.com/store/apps/details?id=app.example",
        "status": {
            "active": true,     // Whether app is currently active
            "message": {        // Only needed if active is false
                "en": "App is in maintenance mode, please come back later.",
                "es": "La aplicación está en modo de mantenimiento, vuelva más tarde."
            }
        }
    },
    "iOS": {
        // Same structure as Android
    },
    // Optional: Include other platforms if needed (macOS, windows, linux)
}

🐞 Need help?

If you encounter any problems or need a feature, please raise a ticket on GitHub.

📃 License

MIT License

カテゴリー

依存関係

依存関係一覧 5 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。