version_update_pk
A lightweight and customizable Flutter package to handle force updates and optional updates with automatic redirection to the Play Store and App Store.
Features
- Force update support (non-dismissible dialog)
- Optional update dialog
- Android Play Store redirection
- iOS App Store redirection
- Version comparison logic
- Simple and clean API
- Lightweight implementation
Installation
Add this to your pubspec.yaml:
dependencies:
version_update_pk: ^1.0.0+1
Then run:
flutter pub get
Usage
Import the package:
import 'package:version_update_pk/version_update_pk.dart';
Basic Example
VersionUpdatePk(
versionUrl: "your_custom_url",
),
Using With Backend API
Your backend should return the following JSON:
{
"latest_version": "1.2.0",
"minimum_version": "1.1.0",
"release_notes": "Bug fixes and performance improvements.",
"force_update": "0", // If it is "1", force update
"android_app_url": "", // Provide your android App URL
"ios_app_url": "" // Provide your ios App url
}
Platform Support
- Android
- iOS
How It Works
The package compares:
currentVersion < minimumVersion
If true:
- Force update dialog is shown.
If currentVersion is lower than latestVersion:
- Optional update dialog is shown.
License
MIT License