内更
This commit is contained in:
parent
f9d934e9ee
commit
14fbbe356f
@ -6,7 +6,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../main.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../../util/util.dart';
|
||||
|
||||
@ -127,16 +126,27 @@ class _CustomDialogState extends State<UpdateDialog> {
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () async {
|
||||
if (Platform.isIOS) {
|
||||
final String appStoreUrl =
|
||||
'https://apps.apple.com/app/id$IOS_APP_ID'; // App Store链接示例
|
||||
final String appStoreUrl = widget.updateInfo.downloadUrl; // App Store链接示例
|
||||
if (await canLaunch(appStoreUrl)) {
|
||||
await launch(appStoreUrl);
|
||||
await launch(appStoreUrl,forceSafariVC : false);
|
||||
} else {
|
||||
throw 'Could not open App Store.';
|
||||
}
|
||||
} else {
|
||||
updataApk(widget.updateInfo.downloadUrl);
|
||||
|
||||
final String appStoreUrl = widget.updateInfo.downloadUrl; // App Store链接示例
|
||||
|
||||
if(appStoreUrl.contains("apk")){
|
||||
updataApk(appStoreUrl);
|
||||
setDownloadUi();
|
||||
}else{
|
||||
if (await canLaunch(appStoreUrl)) {
|
||||
await launch(appStoreUrl,forceSafariVC : false);
|
||||
} else {
|
||||
throw 'Could not open App Store.';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Navigator.pop(context);
|
||||
|
||||
@ -93,12 +93,13 @@ dependencies:
|
||||
#event_bus:
|
||||
event_bus: ^2.0.0
|
||||
#安装apk
|
||||
# flutter_install_app: 1.3.0
|
||||
flutter_install_app: 1.3.0
|
||||
#闪屏页
|
||||
flutter_native_splash: 2.2.16
|
||||
#腾讯离线推送
|
||||
tencent_chat_push_for_china: ^2.6.2+1
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
Loading…
Reference in New Issue
Block a user