Skip to content

Commit

Permalink
change launch url func
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Jul 3, 2024
1 parent aff80fe commit 3b1df38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/common/utils/common_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class CommonUtils {
static launchOutURL(String? url, BuildContext context) async {
var gl = GSYLocalizations.i18n(context);
if (url != null && await canLaunchUrl(Uri.parse(url))) {
await launchUrl(Uri.parse(url));
await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);
} else {
Fluttertoast.showToast(
msg: "${gl!.option_web_launcher_error}: ${url ?? ""}");
Expand Down Expand Up @@ -413,8 +413,7 @@ class CommonUtils {
children: <Widget>[
const SpinKitCubeGrid(color: GSYColors.white),
Container(height: 10.0),
Text(
GSYLocalizations.i18n(context)!.loading_text,
Text(GSYLocalizations.i18n(context)!.loading_text,
style: GSYConstant.normalTextWhite),
],
),
Expand Down Expand Up @@ -516,7 +515,8 @@ class CommonUtils {
child: Text(GSYLocalizations.i18n(context)!.app_cancel)),
TextButton(
onPressed: () {
launchUrl(Uri.parse(Address.updateUrl));
launchUrl(Uri.parse(Address.updateUrl),
mode: LaunchMode.externalApplication);
Navigator.pop(context);
},
child: Text(GSYLocalizations.i18n(context)!.app_ok)),
Expand Down
8 changes: 4 additions & 4 deletions lib/page/release/release_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class ReleasePage extends StatefulWidget {
final String releaseUrl;
final String tagUrl;

const ReleasePage(this.userName, this.reposName, this.releaseUrl, this.tagUrl, {super.key});
const ReleasePage(this.userName, this.reposName, this.releaseUrl, this.tagUrl,
{super.key});

@override
_ReleasePageState createState() => _ReleasePageState();
Expand Down Expand Up @@ -65,10 +66,9 @@ class _ReleasePageState extends State<ReleasePage>
String url = _getUrl();
var gl = GSYLocalizations.i18n(context);
if (await canLaunchUrl(Uri.parse(url))) {
await launchUrl(Uri.parse(url));
await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);
} else {
Fluttertoast.showToast(
msg: "${gl!.option_web_launcher_error}: $url");
Fluttertoast.showToast(msg: "${gl!.option_web_launcher_error}: $url");
}
}

Expand Down

0 comments on commit 3b1df38

Please sign in to comment.