Browse Source

use vanlilla launchUrl for support email

Neeraj Gupta 3 years ago
parent
commit
dd05bc863a
2 changed files with 8 additions and 7 deletions
  1. 2 0
      lib/core/constants.dart
  2. 6 7
      lib/ui/settings/support_section_widget.dart

+ 2 - 0
lib/core/constants.dart

@@ -28,3 +28,5 @@ const kMnemonicKeyWordCount = 24;
 
 // https://stackoverflow.com/a/61162219
 const kDragSensitivity = 8;
+
+const kSupportEmail = 'support@ente.io';

+ 6 - 7
lib/ui/settings/support_section_widget.dart

@@ -1,13 +1,12 @@
 import 'package:flutter/material.dart';
-import 'package:flutter_email_sender/flutter_email_sender.dart';
 import 'package:logging/logging.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/core/constants.dart';
 import 'package:photos/ui/settings/settings_section_title.dart';
 import 'package:photos/ui/settings/settings_text_item.dart';
 import 'package:photos/ui/web_page.dart';
+import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/email_util.dart';
-import 'package:photos/utils/toast_util.dart';
 import 'package:url_launcher/url_launcher.dart';
 
 class SupportSectionWidget extends StatelessWidget {
@@ -23,14 +22,14 @@ class SupportSectionWidget extends StatelessWidget {
           behavior: HitTestBehavior.translucent,
           onTap: () async {
             try {
-              final Email email = Email(
-                recipients: ['hey@ente.io'],
-                isHTML: false,
+              final Uri emailLaunchUri = Uri(
+                scheme: 'mailto',
+                path: kSupportEmail,
               );
-              await FlutterEmailSender.send(email);
+              launchUrl(emailLaunchUri);
             } catch (e) {
               Logger("SupportSection").severe(e);
-              launch("mailto:hey@ente.io");
+              showErrorDialog(context, "", "please email us at $kSupportEmail");
             }
           },
           child: SettingsTextItem(text: "email", icon: Icons.navigate_next),