flutter_in_store_app_version_checker

Pub Version popularity likes codecov style: flutter lints

Description

A lightweight Flutter plugin to check whether your app (or any other app) has a newer version published on Google Play, ApkPure, or Apple App Store.

Add the dependency:

dependencies:
  flutter_in_store_app_version_checker: <current>

Supported platforms

Platform Stores
Android Google Play, ApkPure
iOS Apple App Store

Other platforms (Web, Windows, Linux, macOS, etc.) are not supported.

Supported Android stores

Android enum value Description
InStoreAppVersionChecker$AndroidStore.googlePlayStore Default Google Play flow
InStoreAppVersionChecker$AndroidStore.apkPure Alternative ApkPure scrape

API Overview

Main access point: InStoreAppVersionChecker (singleton: InStoreAppVersionChecker.instance) returning IInStoreAppVersionChecker implemented by InStoreAppVersionChecker.

Request parameters: InStoreAppVersionChecker$Params

Response object: InStoreAppVersionChecker$Response

Key response fields:

  • isSuccess / isError
  • currentVersion
  • newVersion
  • canUpdate
  • appURL
  • errorMessage

Version comparison logic considers:

  • Pre-release tokens (numeric and mixed) after core version comparison.
  • Build metadata (+xyz) is ignored for equality/update decisions.
  • Whitespace trimmed; non-alphanumeric symbols stripped (see tests).
  • Mixed alphanumeric pre-release segments compared token-by-token with numeric-aware ordering.

Example

Simple check (Play Store HTML with fallback API)

import 'package:flutter_in_store_app_version_checker/flutter_in_store_app_version_checker.dart';

Future<void> check() async {
  final res = await InStoreAppVersionChecker.instance.checkUpdate(
    const InStoreAppVersionChecker$Params(
      locale: 'en',
      // packageName:    'com.example.app', // optional override
      // currentVersion: '1.2.3',           // optional override
      // androidStore:   InStoreAppVersionChecker$AndroidStore.apkPure,
    ),
  );
  if (res.isSuccess) {
    print('Current: ${res.currentVersion}');
    print('New    : ${res.newVersion}');
    print('Url    : ${res.appURL}');
    print('Update : ${res.canUpdate}');
  } else {
    print('Error: ${res.errorMessage}');
  }
}

ApkPure

final res = await InStoreAppVersionChecker.instance.checkUpdate(
  const InStoreAppVersionChecker$Params(
    locale: 'en',
    androidStore: InStoreAppVersionChecker$AndroidStore.apkPure,
  ),
);

iOS

final res = await InStoreAppVersionChecker.instance.checkUpdate(
  const InStoreAppVersionChecker$Params(locale: 'en'),
);

Custom HTTP client

final custom = InStoreAppVersionChecker.custom(httpClient: myClient);
final res = await custom.checkUpdate(
  const InStoreAppVersionChecker$Params(locale: 'en'),
);

Version comparison notes

  • Release vs pre-release: a pure release is considered higher than a pre-release with the same core; therefore if current is release and new is pre-release -> treated as update (legacy-compatible).
  • Numeric pre-release tokens compared numerically; mixed/alphanumeric tokens compared lexicographically after numeric segments.
  • Trailing zero segment normalization: 1.2 equals 1.2.0 (no update).
  • Fully non-numeric current vs numeric new => update.
  • Fully non-numeric new vs numeric current => no update.
  • Build metadata (+build) ignored. See unit tests in test/unit for authoritative behavior.

Error handling

Types:

  • success
  • error (network failures, app not found, unsupported platform)

errorMessage is populated only for error responses. An error response may still indicate canUpdate == true if newVersion is greater.

Changelog

Refer to the Changelog to get all release notes.

Maintainers

Anton Ustinoff (ziqq)

License

MIT

Funding

If you want to support the development of our library, there are several ways you can do it:

Coverage