update_checker_bottom_sheet 0.0.1
update_checker_bottom_sheet: ^0.0.1 copied to clipboard
A premium, highly customizable Flutter package to check for app updates via GitHub Releases, with built-in OTA downloading and installation support for Android.
Update Checker Bottom Sheet #
A premium, highly customizable Flutter package to seamlessly check for app updates via GitHub Releases. It provides a beautiful, user-friendly bottom sheet that handles version comparison, OTA downloading, and installation on Android.
๐ Index #
- Screenshots
- Features
- Installation
- Android Setup
- Usage
- Customization
- GitHub Release Best Practices (Important)
- Note on Versioning (Important)
- License
๐ธ Screenshots #
| Update Available | Downloading | Installing |
|---|---|---|
| [Update Available] | [Downloading] | [Installing] |
โจ Features #
- Android Native Support: Built specifically for Android with 100% compatibility for current build systems.
- OTA Updates: Handles the full lifecycleโfetching, downloading, and triggering the Android Package Installer.
- GitHub Integration: Automatically parses latest release tags, changelogs, and APK assets.
- Architecture Awareness: Intelligently detects device ABI (
arm64-v8a,armeabi-v7a,x86_64) and selects the matching APK. - "Up to Date" Notification: Optionally show a success UI if no update is found.
๐ฆ Installation #
Add this package to your pubspec.yaml:
dependencies:
update_checker_bottom_sheet:
git:
url: https://github.com/jdmakes/update_checker_bottom_sheet.git
๐ ๏ธ Android Setup #
This package is designed for maximum simplicity. The only manual requirement is enabling Core Library Desugaring.
1. Enable Desugaring #
The underlying OTA engine requires desugaring to support older Android versions.
android/app/build.gradle (or build.gradle.kts):
android {
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
}
2. Permissions #
The package automatically bundles the necessary permissions:
INTERNETREQUEST_INSTALL_PACKAGESREAD_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE
๐ Usage #
Simple Check #
Automatically checks GitHub and shows the sheet only if an update is found.
import 'package:update_checker_bottom_sheet/update_checker_bottom_sheet.dart';
void _checkForUpdates() async {
await UpdateCheckerBottomSheet.checkAndUpdate(
context,
config: const UpdateCheckerConfig(
githubRepo: "username/repo", // e.g. "jydv402/ZenUnni"
),
);
}
Force "Up to Date" UI #
Useful for "Check for Updates" buttons in a Settings menu.
await UpdateCheckerBottomSheet.checkAndUpdate(
context,
showIfUpToDate: true, // Shows "You are using the latest version" if no update
config: const UpdateCheckerConfig(githubRepo: "username/repo"),
);
โ ๏ธ Important: Cleaning Up Old APK Files #
The checkAndUpdate function automatically cleans up old APK files from previous downloads to save storage space on the user's device. This ensures a smooth user experience without cluttering the device with temporary files.
๐ View the Sample Implementation
๐จ Customization #
We believe in deep customization. You can control every pixel, color, and string used in the bottom sheet.
๐ View the Full Customization Guide
๐ค GitHub Release Best Practices (IMPORTANT) #
Important
To ensure the package correctly identifies and downloads your APKs, follow these guidelines when creating a GitHub Release:
- ABI Naming: The package looks for ABI names in the asset filenames. If your release has multiple APKs, name them like so:
app-arm64-v8a-release.apkapp-armeabi-v7a-release.apkapp-x86_64-release.apk
- Split per ABI: Use
flutter build apk --split-per-abito generate these files automatically. - Fallback Support: If no ABI-specific match is found, the package will fallback to assets named
universal.apkorapp-release.apk. - Changelog: The text in the GitHub Release "Description" field is automatically pulled and displayed as the "What's New" content.
๐ Note on Versioning (IMPORTANT) #
Important
Version comparison is the core of this package. Here is how it works:
- Semantic Versioning: It compares your local version (from
pubspec.yaml) with the GitHub Release Tag. - Build Numbers: It supports and compares build numbers (e.g.,
1.2.0+5is recognized as newer than1.2.0+4). - Tag Formatting: It gracefully handles
vprefixes (e.g., Tagv1.0.0matches Version1.0.0). - Pre-releases: Ensure your tags follow standard semantic versioning for predictable results.
๐ License #
This project is licensed under the MIT License - see the LICENSE file for details.