### Get Package Information - Dart Source: https://github.com/tranglequynh/flutter-upgrade-version/blob/dev/README.md Retrieves general information about the application package, including app name, package name, version, build number, and locale details. This function is part of the `PackageManager` class. ```dart import 'package:flutter_upgrade_version/flutter_upgrade_version.dart'; Future getPackageData() async { PackageInfo _packageInfo = await PackageManager.getPackageInfo(); } ``` -------------------------------- ### Get iOS App Store Version Source: https://github.com/tranglequynh/flutter-upgrade-version/blob/dev/README.md Retrieves version information for an iOS app from the Apple App Store using the package name and an optional region code. Requires the app ID to exist on the store. The `regionCode` parameter is optional, defaulting to 'US'. ```dart ///iOS if (Platform.isIOS) { VersionInfo? _versionInfo2 = await UpgradeVersion.getiOSStoreVersion( packageInfo: _packageInfo, regionCode: 'VN', ); ///Example: VN - Viet Nam } ``` -------------------------------- ### Android In-app Update Management - Dart Source: https://github.com/tranglequynh/flutter-upgrade-version/blob/dev/README.md Manages in-app updates for Android applications. It checks for available updates, and if available, initiates either an immediate or flexible update flow based on what is allowed. This feature requires Android 5.0 (API level 21) or higher. ```dart /// Android if (Platform.isAndroid) { InAppUpdateManager manager = InAppUpdateManager(); AppUpdateInfo? appUpdateInfo = await manager.checkForUpdate(); if (appUpdateInfo == null) return; //Exception if (appUpdateInfo.updateAvailability == UpdateAvailability.developerTriggeredUpdateInProgress) { ///If an in-app update is already running, resume the update. String? message = await manager.startAnUpdate(type: AppUpdateType.immediate); ///message return null when run update success } else if (appUpdateInfo.updateAvailability == UpdateAvailability.updateAvailable) { ///Update available if (appUpdateInfo.immediateAllowed) { debugPrint('Start an immediate update'); String? message = await manager.startAnUpdate(type: AppUpdateType.immediate); ///message return null when run update success } else if (appUpdateInfo.flexibleAllowed) { debugPrint('Start an flexible update'); String? message = await manager.startAnUpdate(type: AppUpdateType.flexible); ///message return null when run update success } else { debugPrint('Update available. Immediate & Flexible Update Flow not allow'); } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.