Skip to content

Commit 3b1df38

Browse files
committed
change launch url func
1 parent aff80fe commit 3b1df38

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/common/utils/common_utils.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ class CommonUtils {
383383
static launchOutURL(String? url, BuildContext context) async {
384384
var gl = GSYLocalizations.i18n(context);
385385
if (url != null && await canLaunchUrl(Uri.parse(url))) {
386-
await launchUrl(Uri.parse(url));
386+
await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);
387387
} else {
388388
Fluttertoast.showToast(
389389
msg: "${gl!.option_web_launcher_error}: ${url ?? ""}");
@@ -413,8 +413,7 @@ class CommonUtils {
413413
children: <Widget>[
414414
const SpinKitCubeGrid(color: GSYColors.white),
415415
Container(height: 10.0),
416-
Text(
417-
GSYLocalizations.i18n(context)!.loading_text,
416+
Text(GSYLocalizations.i18n(context)!.loading_text,
418417
style: GSYConstant.normalTextWhite),
419418
],
420419
),
@@ -516,7 +515,8 @@ class CommonUtils {
516515
child: Text(GSYLocalizations.i18n(context)!.app_cancel)),
517516
TextButton(
518517
onPressed: () {
519-
launchUrl(Uri.parse(Address.updateUrl));
518+
launchUrl(Uri.parse(Address.updateUrl),
519+
mode: LaunchMode.externalApplication);
520520
Navigator.pop(context);
521521
},
522522
child: Text(GSYLocalizations.i18n(context)!.app_ok)),

lib/page/release/release_page.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class ReleasePage extends StatefulWidget {
2424
final String releaseUrl;
2525
final String tagUrl;
2626

27-
const ReleasePage(this.userName, this.reposName, this.releaseUrl, this.tagUrl, {super.key});
27+
const ReleasePage(this.userName, this.reposName, this.releaseUrl, this.tagUrl,
28+
{super.key});
2829

2930
@override
3031
_ReleasePageState createState() => _ReleasePageState();
@@ -65,10 +66,9 @@ class _ReleasePageState extends State<ReleasePage>
6566
String url = _getUrl();
6667
var gl = GSYLocalizations.i18n(context);
6768
if (await canLaunchUrl(Uri.parse(url))) {
68-
await launchUrl(Uri.parse(url));
69+
await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);
6970
} else {
70-
Fluttertoast.showToast(
71-
msg: "${gl!.option_web_launcher_error}: $url");
71+
Fluttertoast.showToast(msg: "${gl!.option_web_launcher_error}: $url");
7272
}
7373
}
7474

0 commit comments

Comments
 (0)