📱 Flutter App Version Checker Fixed
A modern, lightweight Flutter package for checking app version updates on Google Play Store and Apple App Store with enhanced error handling and improved reliability.
Features • Installation • Usage • API Reference • Contributing
✨ Features
| Feature | Description |
|---|---|
| 🔄 Version Comparison | Smart version comparison with semantic versioning support |
| 🏪 Multi-Store Support | Google Play Store, Apple App Store, and APKPure |
| 🎯 Auto-Detection | Automatic app ID and version detection |
| 🛡️ Error Handling | Comprehensive error reporting and debugging |
| 📱 Cross-Platform | Full Android and iOS support |
| ⚡ Lightweight | Minimal dependencies and fast performance |
| 🔧 Customizable | Flexible configuration options |
🚀 Installation
Add this to your package's pubspec.yaml file:
dependencies:
flutter_app_version_checker_fixed: ^0.3.3
Then run:
flutter pub get
📦 Alternative Installation Methods
From GitHub (Latest)
dependencies:
flutter_app_version_checker_fixed:
git:
url: https://github.com/boughdiri-dorsaf/flutter_app_version_checker_fixed.git
ref: main
From Local Path
dependencies:
flutter_app_version_checker_fixed:
path: ./path/to/flutter_app_version_checker_fixed
📱 Platform Support
| Platform | Play Store | App Store | APKPure | Auto-Detection |
|---|---|---|---|---|
| Android | ✅ | ❌ | ✅ | ✅ |
| iOS | ❌ | ✅ | ❌ | ✅ |
🔧 Quick Start
Basic Usage
import 'package:flutter_app_version_checker_fixed/flutter_app_version_checker.dart';
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final _checker = AppVersionChecker();
@override
void initState() {
super.initState();
_checkForUpdates();
}
Future<void> _checkForUpdates() async {
try {
final result = await _checker.checkUpdate();
if (result.canUpdate) {
_showUpdateDialog(result);
} else {
print('App is up to date!');
}
} catch (e) {
print('Error checking for updates: $e');
}
}
void _showUpdateDialog(AppCheckerResult result) {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Update Available'),
content: Text('New version ${result.newVersion} is available!'),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('Later'),
),
ElevatedButton(
onPressed: () {
// Open app store
launchUrl(Uri.parse(result.appURL ?? ''));
Navigator.pop(context);
},
child: Text('Update'),
),
],
),
);
}
}
Advanced Configuration
// Custom app ID and version
final checker = AppVersionChecker(
appId: "com.example.myapp",
currentVersion: "1.0.0",
androidStore: AndroidStore.googlePlayStore,
);
// Check specific app
final result = await checker.checkUpdate();
Using Different Android Stores
// Google Play Store (default)
final playStoreChecker = AppVersionChecker(
androidStore: AndroidStore.googlePlayStore,
);
// APKPure Store
final apkPureChecker = AppVersionChecker(
appId: "com.vanced.android.youtube",
androidStore: AndroidStore.apkPure,
);
📚 API Reference
AppVersionChecker Class
Constructor
AppVersionChecker({
String? appId, // App identifier (auto-detected if null)
String? currentVersion, // Current version (auto-detected if null)
AndroidStore? androidStore, // Android store to use
})
Methods
| Method | Return Type | Description |
|---|---|---|
checkUpdate() |
Future<AppCheckerResult> |
Check for app updates |
AppCheckerResult Class
Properties
| Property | Type | Description |
|---|---|---|
canUpdate |
bool |
Whether an update is available |
currentVersion |
String |
Current app version |
newVersion |
String? |
Latest available version |
appURL |
String? |
App store URL |
errorMessage |
String? |
Error message if any |
AndroidStore Enum
AndroidStore.googlePlayStore- Google Play Store (default)AndroidStore.apkPure- APKPure store
🛠️ Setup
Android Setup
No additional configuration required! The package automatically detects your app ID and version.
iOS Setup
No additional configuration required! The package automatically detects your app ID and version.
🚨 Troubleshooting
Common Issues
❌ No Update Detected
- Verify the app ID is correct
- Check if the app exists on the specified store
- Ensure the app is published and available
🌐 Network Errors
- Check internet connectivity
- Verify store URLs are accessible
- Handle network timeouts gracefully
📱 Store Not Found
- Confirm the app exists on the specified store
- Check app ID format (e.g., com.example.app)
- Verify store selection is correct
Debug Information
final checker = AppVersionChecker();
final result = await checker.checkUpdate();
print('''
Debug Information:
- Can update: ${result.canUpdate}
- Current version: ${result.currentVersion}
- New version: ${result.newVersion}
- App URL: ${result.appURL}
- Error: ${result.errorMessage ?? 'None'}
''');
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
flutter test - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
📞 Support
| Support Channel | Description |
|---|---|
| 🐛 Issues | Report bugs and request features |
| 💬 Discussions | Ask questions and share ideas |
| Contact the maintainer directly |
🔄 Changelog
See CHANGELOG.md for a detailed list of changes and updates.
⭐ Show Your Support
If this package helped you, please give it a ⭐ on pub.dev and GitHub!
Made with ❤️ by boughdiri-dorsaf