From 40d3ba5488dd294f8bb9870f825c7e1460490ceb Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Mon, 11 Jul 2022 09:21:08 +0530 Subject: [PATCH] Lint: replace launch with launchUrlString for web urls --- lib/ui/payment/stripe_subscription_page.dart | 6 +++--- lib/ui/payment/subscription_page.dart | 6 +++--- lib/ui/settings/backup_section_widget.dart | 14 +++++++++----- lib/ui/settings/social_section_widget.dart | 12 ++++++------ 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/lib/ui/payment/stripe_subscription_page.dart b/lib/ui/payment/stripe_subscription_page.dart index 5b14edfc3..2d17449cd 100644 --- a/lib/ui/payment/stripe_subscription_page.dart +++ b/lib/ui/payment/stripe_subscription_page.dart @@ -21,7 +21,7 @@ import 'package:photos/ui/payment/subscription_plan_widget.dart'; import 'package:photos/utils/dialog_util.dart'; import 'package:photos/utils/toast_util.dart'; import 'package:step_progress_indicator/step_progress_indicator.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class StripeSubscriptionPage extends StatefulWidget { final bool isOnboarding; @@ -224,14 +224,14 @@ class _StripeSubscriptionPageState extends State { await _launchStripePortal(); break; case kPlayStore: - launch( + launchUrlString( "https://play.google.com/store/account/subscriptions?sku=" + _currentSubscription.productID + "&package=io.ente.photos", ); break; case kAppStore: - launch("https://apps.apple.com/account/billing"); + launchUrlString("https://apps.apple.com/account/billing"); break; default: _logger.severe( diff --git a/lib/ui/payment/subscription_page.dart b/lib/ui/payment/subscription_page.dart index 4472d62da..f1e42bcb0 100644 --- a/lib/ui/payment/subscription_page.dart +++ b/lib/ui/payment/subscription_page.dart @@ -20,7 +20,7 @@ import 'package:photos/ui/payment/subscription_common_widgets.dart'; import 'package:photos/ui/payment/subscription_plan_widget.dart'; import 'package:photos/utils/dialog_util.dart'; import 'package:photos/utils/toast_util.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class SubscriptionPage extends StatefulWidget { final bool isOnboarding; @@ -213,13 +213,13 @@ class _SubscriptionPageState extends State { return; } if (Platform.isAndroid) { - launch( + launchUrlString( "https://play.google.com/store/account/subscriptions?sku=" + _currentSubscription.productID + "&package=io.ente.photos", ); } else { - launch("https://apps.apple.com/account/billing"); + launchUrlString("https://apps.apple.com/account/billing"); } }, child: Container( diff --git a/lib/ui/settings/backup_section_widget.dart b/lib/ui/settings/backup_section_widget.dart index d0746df3a..2f90e01cc 100644 --- a/lib/ui/settings/backup_section_widget.dart +++ b/lib/ui/settings/backup_section_widget.dart @@ -18,7 +18,7 @@ import 'package:photos/utils/data_util.dart'; import 'package:photos/utils/dialog_util.dart'; import 'package:photos/utils/navigation_util.dart'; import 'package:photos/utils/toast_util.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class BackupSectionWidget extends StatefulWidget { const BackupSectionWidget({Key key}) : super(key: key); @@ -229,11 +229,13 @@ class BackupSectionWidgetState extends State { Navigator.of(context, rootNavigator: true).pop('dialog'); // TODO: Replace with https://pub.dev/packages/in_app_review if (Platform.isAndroid) { - launch( + launchUrlString( "https://play.google.com/store/apps/details?id=io.ente.photos", ); } else { - launch("https://apps.apple.com/in/app/ente-photos/id1542026904"); + launchUrlString( + "https://apps.apple.com/in/app/ente-photos/id1542026904", + ); } }, ), @@ -289,11 +291,13 @@ class BackupSectionWidgetState extends State { Navigator.of(context, rootNavigator: true).pop('dialog'); // TODO: Replace with https://pub.dev/packages/in_app_review if (Platform.isAndroid) { - launch( + launchUrlString( "https://play.google.com/store/apps/details?id=io.ente.photos", ); } else { - launch("https://apps.apple.com/in/app/ente-photos/id1542026904"); + launchUrlString( + "https://apps.apple.com/in/app/ente-photos/id1542026904", + ); } }, ), diff --git a/lib/ui/settings/social_section_widget.dart b/lib/ui/settings/social_section_widget.dart index 352da3ee3..7756622d7 100644 --- a/lib/ui/settings/social_section_widget.dart +++ b/lib/ui/settings/social_section_widget.dart @@ -6,7 +6,7 @@ import 'package:photos/services/update_service.dart'; import 'package:photos/ui/settings/common_settings.dart'; import 'package:photos/ui/settings/settings_section_title.dart'; import 'package:photos/ui/settings/settings_text_item.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class SocialSectionWidget extends StatelessWidget { const SocialSectionWidget({Key key}) : super(key: key); @@ -26,7 +26,7 @@ class SocialSectionWidget extends StatelessWidget { GestureDetector( behavior: HitTestBehavior.translucent, onTap: () { - launch("https://twitter.com/enteio"); + launchUrlString("https://twitter.com/enteio"); }, child: const SettingsTextItem(text: "Twitter", icon: Icons.navigate_next), @@ -35,7 +35,7 @@ class SocialSectionWidget extends StatelessWidget { GestureDetector( behavior: HitTestBehavior.translucent, onTap: () { - launch("https://ente.io/discord"); + launchUrlString("https://ente.io/discord"); }, child: const SettingsTextItem(text: "Discord", icon: Icons.navigate_next), @@ -44,7 +44,7 @@ class SocialSectionWidget extends StatelessWidget { GestureDetector( behavior: HitTestBehavior.translucent, onTap: () { - launch("https://reddit.com/r/enteio"); + launchUrlString("https://reddit.com/r/enteio"); }, child: const SettingsTextItem(text: "Reddit", icon: Icons.navigate_next), @@ -58,11 +58,11 @@ class SocialSectionWidget extends StatelessWidget { behavior: HitTestBehavior.translucent, onTap: () { if (Platform.isAndroid) { - launch( + launchUrlString( "https://play.google.com/store/apps/details?id=io.ente.photos", ); } else { - launch( + launchUrlString( "https://apps.apple.com/in/app/ente-photos/id1542026904", ); }