Forráskód Böngészése

Lint: replace launch with launchUrlString for web urls

Neeraj Gupta 3 éve
szülő
commit
40d3ba5488

+ 3 - 3
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<StripeSubscriptionPage> {
                   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(

+ 3 - 3
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<SubscriptionPage> {
                 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(

+ 9 - 5
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<BackupSectionWidget> {
             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<BackupSectionWidget> {
             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",
+              );
             }
           },
         ),

+ 6 - 6
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",
                 );
               }