app_version_update
로컬 앱이 해당 스토어(플레이 스토어/애플 스토어)와 동일한 버전으로 업데이트되었는지 확인하는 간단하고 빠른 방법입니다.
[Flutter 패키지] 로컬 앱이 해당 스토어(플레이 스토어/애플 스토어)에서 동일한 버전으로 업데이트되었는지 쉽게 빠르게 확인하는 방법입니다.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Retrieve version and url for local app update against store app Android and iOS
Using as reference packages like in_app_update , version_check.
Compares local version with the respective store version for the purpose of detecting user-side version updates.
It also provides widgets like dialog , bottom sheets and pages for you to display the update option to the user.
$ flutter pub add app_version_update
or add in your dependencies
dependencies:
app_version_update: <latest>
to use this app you need to have the app hosted in stores.
To test, you can manually downgrade your pubspec.yaml from your version: , when you run your local version it will be different from the store version
Internet permission Android:
<uses-permission android:name="android.permission.INTERNET" />
Internet permission iOs:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>
final appleId = '284882215'; // If this value is null, its packagename will be considered
final playStoreId = 'com.facebook.katana'; // If this value is null, its packagename will be considered
await AppVersionUpdate.checkForUpdates(
appleId: appleId, playStoreId: playStoreId)
.then((data) async {
print(data.storeUrl);
print(data.storeVersion);
if(data.canUpdate!){
//showDialog(... your custom widgets view)
//or use our widgets
// AppVersionUpdate.showAlertUpdate
// AppVersionUpdate.showBottomSheetUpdate
// AppVersionUpdate.showPageUpdate
AppVersionUpdate.showAlertUpdate(
appVersionResult: data, context: context);
}
});
Customize the Alert Dialog
// you also have some options to customize our Alert Dialog
AppUpdateVersion.showAlertUpdate(
{BuildContext? context,
AppVersionResult? appVersionResult,
bool? mandatory = false,
String? title = 'New version available',
TextStyle titleTextStyle =
const TextStyle(fontSize: 24.0, fontWeight: FontWeight.w500),
String? content = 'Would you like to update your application?',
TextStyle contentTextStyle =
const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400),
ButtonStyle? cancelButtonStyle = const ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.redAccent)),
ButtonStyle? updateButtonStyle = const ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.green)),
String? cancelButtonText = 'UPDATE LATER',
String? updateButtonText = 'UPDATE',
TextStyle? cancelTextStyle = const TextStyle(color: Colors.white),
TextStyle? updateTextStyle = const TextStyle(color: Colors.white),
Color? backgroundColor = Colors.white})
Customize the our bottom sheet
AppUpdateVersion.showBottomSheetUpdate(
{@required BuildContext? context,
@required AppVersionResult? appVersionResult,
bool? mandatory = false,
String? title = 'New version avaible',
Widget? content}) async {
await showModalBottomSheet(
isDismissible: !mandatory!,
context: context!,
builder: (context) => BottomSheetUpdateVersion(
appVersionResult: appVersionResult,
mandatory: mandatory,
content: content,
title: title,
));
}
Customize the Page
// you also have some options to customize our Page
AppUpdateVersion.showPageUpdate(
{@required BuildContext? context,
@required AppVersionResult? appVersionResult,
bool? mandatory = false,
Widget? page}) async {
Navigator.push(
context!,
MaterialPageRoute(
builder: (context) =>
page ??
UpdateVersionPage(
mandatory: mandatory,
appVersionResult: appVersionResult,
)));
}
| Next Updates | status |
|---|---|
| Mandatory or optional update | released |
| Create TestMode | development |
| Bottom sheet widget | released |
| Page widget | released |
| Handle Exceptions | development |
| New options custom widgets | released |
| Automatic country detection | released |
| Modularize files | listed |
This project is at an initial level, more functions will be included as
So any suggestion and contribution is welcome.
의존성 목록 7 개
{"sdk":"flutter"}1.6.0^10.1.0^6.3.2^0.15.4{"sdk":"flutter"}^6.0.0사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗