github_apk_updater 1.0.1
github_apk_updater: ^1.0.1 copied to clipboard
Auto-update your Flutter Android app via GitHub Releases. Zero cost, zero third-party services, zero server needed. Just push to GitHub — users get update dialog automatically.
github_apk_updater #
Auto-update your Flutter Android app via GitHub Releases — no server, no third-party service.
Setup #
1. Add dependency #
dependencies:
github_apk_updater: ^1.0.0
2. Add version.json to your project root #
{
"latest_version": "1.0.0",
"apk_url": "https://github.com/USERNAME/REPO/releases/download/v1.0.0/app-release.apk",
"force_update": false,
"release_notes": "Initial release."
}
3. Add to your home screen #
import 'package:github_apk_updater/github_apk_updater.dart';
final updater = GithubApkUpdater(
config: UpdaterConfig(
githubUsername: 'your_username',
githubRepo: 'your_repo',
),
);
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
updater.check(context);
});
}
Configuration #
| Option | Default | Description |
|---|---|---|
githubUsername |
required | Your GitHub username |
githubRepo |
required | Your repository name |
branch |
main |
Branch with version.json |
dialogTitle |
Update Available |
Dialog title |
updateButtonText |
Update Now |
Update button label |
laterButtonText |
Later |
Dismiss button label |
Force Update #
Set force_update: true in version.json — users cannot dismiss the dialog.
Custom UI #
final info = await updater.getUpdateInfo();
if (info != null && info.hasUpdate) {
// use info.latestVersion, info.apkUrl, info.releaseNotes
}
Android Permission #
Add to AndroidManifest.xml:
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>