├── .github └── workflows │ ├── format.yml │ └── lint.yml ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── kotlin │ └── com │ └── homex │ └── open_mail_app │ └── OpenMailAppPlugin.kt ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── homex │ │ │ │ │ └── open_mail_app_example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ └── main.dart └── pubspec.yaml ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── OpenMailAppPlugin.h │ ├── OpenMailAppPlugin.m │ └── SwiftOpenMailAppPlugin.swift └── open_mail_app.podspec ├── lib └── open_mail_app.dart ├── pubspec.yaml └── test └── open_mail_app_test.dart /.github/workflows/format.yml: -------------------------------------------------------------------------------- 1 | name: Format 2 | on: 3 | push: 4 | branches: 5 | - master 6 | pull_request: 7 | 8 | jobs: 9 | format: 10 | name: Format 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: subosito/flutter-action@v1 15 | with: 16 | flutter-version: '2.10.0' 17 | channel: 'stable' 18 | - run: flutter format . --set-exit-if-changed -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | on: 3 | push: 4 | branches: 5 | - master 6 | pull_request: 7 | 8 | jobs: 9 | lint: 10 | name: Lint 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: subosito/flutter-action@v1 15 | with: 16 | flutter-version: '2.10.0' 17 | channel: 'stable' 18 | - run: flutter pub get 19 | - run: flutter analyze -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .idea 10 | open_mail_app.iml 11 | 12 | # Ignore for libs 13 | pubspec.lock -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: e6b34c2b5c96bb95325269a29a84e83ed8909b5f 8 | channel: stable 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.4.4 2 | - Support Flutter 2.10.0 3 | - Update Android compileSdkVersion to 31 (Android 12) 4 | 5 | ## 0.4.3 6 | 7 | - Android: migrate from jcenter to mavenCentral 8 | - Updated Gradle to 7.0.2 9 | - Updated Gradle Build Tools to 7.0.4 10 | 11 | ## 0.4.2 12 | Thanks to deathcoder for the following fix 13 | 14 | - Updated Kotlin to 1.6.10 15 | - Updated Gradle to 7.0.2 (example) 16 | - Updated Gradle Build Tools to 7.0.4 (example) 17 | 18 | ## 0.4.1 19 | Thanks to LosDanieloss for the following fix 20 | 21 | - Fix composing a new email on iOS when there is only one email app installed 22 | 23 | ## 0.4.0 24 | 25 | - Added ProtonMail 26 | - Bumped min iOS version to 9 27 | 28 | ## 0.3.0 29 | 30 | - Added the ability to mock platform during testing to make it easier to write tests 31 | 32 | ## 0.2.0 33 | 34 | - Added possibility to call a specific email app and compose a new email. 35 | 36 | ## 0.1.1 37 | 38 | - Added optional list for filtering mail apps by name. 39 | 40 | ## 0.1.0 41 | 42 | - Null safety stable release 43 | 44 | ## 0.0.8 45 | 46 | Thanks to martyfuhry for the following fix 47 | 48 | - Fixed opening mail apps not working on Android when targetSdkVersion is 30 49 | 50 | ## 0.0.7 51 | 52 | Thanks to PrinceGoyal for the following improvement 53 | 54 | - Update gradle to 6.7.1 from 5.6.2 55 | 56 | ## 0.0.6 57 | 58 | Thanks to nerder for the following feature 59 | 60 | - Added the option to set the title of the native picker for Android 61 | - Added title parameter for MailAppPickerDialog 62 | 63 | ## 0.0.5 64 | 65 | - Fixed MailApp name being null when building on Android when minifyEnabled is set to true 66 | 67 | ## 0.0.3 68 | 69 | Thanks to andrzejchm for the following bug fix. 70 | 71 | - Fix null pointer exception on Android 72 | 73 | ## 0.0.2 74 | 75 | - Update description in pubspec 76 | 77 | ## 0.0.1 78 | 79 | - Initial release. 80 | - Open email apps 81 | - Get list of installed email apps 82 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 HomeX 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Open Mail App Flutter ![Flutter 2.10.0](https://img.shields.io/badge/Flutter-2.10.0-blue) 2 | [![pub package](https://img.shields.io/pub/v/open_mail_app.svg?label=open_mail_app&color=blue)](https://pub.dev/packages/open_mail_app) 3 | 4 | A boring but accurate name. 5 | 6 | This library provides the ability to query the device for installed email apps and open those apps. 7 | 8 | If you just want to compose an email or open any app with a `mailto:` link, you are looking for [url_launcher](https://pub.dev/packages/url_launcher). 9 | ## Why 10 | While [url_launcher](https://pub.dev/packages/url_launcher) can help you compose an email or open the default email app, it doesn't give you control over which is opened and it doesn't tell you what is available on the device. This is especially a problem on iOS where only the default [Mail](https://apps.apple.com/us/app/mail/id1108187098) app will be opened, even if the user prefers a different app. 11 | ## Setup 12 | iOS requires you to list the URL schemes you would like to query in the `Info.plist` file. 13 | 14 | ``` 15 | LSApplicationQueriesSchemes 16 | 17 | googlegmail 18 | x-dispatch 19 | readdle-spark 20 | airmail 21 | ms-outlook 22 | ymail 23 | fastmail 24 | superhuman 25 | protonmail 26 | 27 | ``` 28 | 29 | Please file issues to add popular email apps you would like to see on iOS. They need to be added to both your app's `Info.plist` and in the source of this library. 30 | ## Usage 31 | ### Open Mail App With Picker If Multiple 32 | ```dart 33 | import 'package:open_mail_app/open_mail_app.dart'; 34 | 35 | void main() { 36 | runApp(MaterialApp(home: MyApp())); 37 | } 38 | 39 | class MyApp extends StatelessWidget { 40 | @override 41 | Widget build(BuildContext context) { 42 | return RaisedButton( 43 | child: Text("Open Mail App"), 44 | onPressed: () async { 45 | // Android: Will open mail app or show native picker. 46 | // iOS: Will open mail app if single mail app found. 47 | var result = await OpenMailApp.openMailApp(); 48 | 49 | // If no mail apps found, show error 50 | if (!result.didOpen && !result.canOpen) { 51 | showNoMailAppsDialog(context); 52 | 53 | // iOS: if multiple mail apps found, show dialog to select. 54 | // There is no native intent/default app system in iOS so 55 | // you have to do it yourself. 56 | } else if (!result.didOpen && result.canOpen) { 57 | showDialog( 58 | context: context, 59 | builder: (_) { 60 | return MailAppPickerDialog( 61 | mailApps: result.options, 62 | ); 63 | }, 64 | ); 65 | } 66 | }, 67 | ); 68 | } 69 | 70 | void showNoMailAppsDialog(BuildContext context) { 71 | showDialog( 72 | context: context, 73 | builder: (context) { 74 | return AlertDialog( 75 | title: Text("Open Mail App"), 76 | content: Text("No mail apps installed"), 77 | actions: [ 78 | FlatButton( 79 | child: Text("OK"), 80 | onPressed: () { 81 | Navigator.pop(context); 82 | }, 83 | ) 84 | ], 85 | ); 86 | }, 87 | ); 88 | } 89 | } 90 | ``` -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.homex.open_mail_app' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.6.10' 6 | repositories { 7 | google() 8 | mavenCentral() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:7.0.4' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | rootProject.allprojects { 18 | repositories { 19 | google() 20 | mavenCentral() 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | apply plugin: 'kotlin-android' 26 | 27 | android { 28 | compileSdkVersion 31 29 | 30 | sourceSets { 31 | main.java.srcDirs += 'src/main/kotlin' 32 | } 33 | defaultConfig { 34 | minSdkVersion 16 35 | } 36 | lintOptions { 37 | disable 'InvalidPackage' 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 43 | implementation 'com.google.code.gson:gson:2.8.5' 44 | } 45 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'open_mail_app' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/homex/open_mail_app/OpenMailAppPlugin.kt: -------------------------------------------------------------------------------- 1 | package com.homex.open_mail_app 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import android.content.pm.LabeledIntent 6 | import android.net.Uri 7 | import androidx.annotation.NonNull 8 | import com.google.gson.Gson 9 | import com.google.gson.annotations.SerializedName 10 | 11 | import io.flutter.embedding.engine.plugins.FlutterPlugin 12 | import io.flutter.plugin.common.MethodCall 13 | import io.flutter.plugin.common.MethodChannel 14 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler 15 | import io.flutter.plugin.common.MethodChannel.Result 16 | import io.flutter.plugin.common.PluginRegistry.Registrar 17 | 18 | class OpenMailAppPlugin : FlutterPlugin, MethodCallHandler { 19 | private lateinit var channel: MethodChannel 20 | private lateinit var applicationContext: Context 21 | 22 | override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { 23 | // Although getFlutterEngine is deprecated we still need to use it for 24 | // apps not updated to Flutter Android v2 embedding 25 | channel = MethodChannel(flutterPluginBinding.flutterEngine.dartExecutor, "open_mail_app") 26 | channel.setMethodCallHandler(this) 27 | init(flutterPluginBinding.applicationContext) 28 | } 29 | 30 | // This static function is optional and equivalent to onAttachedToEngine. It supports the old 31 | // pre-Flutter-1.12 Android projects. You are encouraged to continue supporting 32 | // plugin registration via this function while apps migrate to use the new Android APIs 33 | // post-flutter-1.12 via https://flutter.dev/go/android-project-migration. 34 | // 35 | // It is encouraged to share logic between onAttachedToEngine and registerWith to keep 36 | // them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called 37 | // depending on the user's project. onAttachedToEngine or registerWith must both be defined 38 | // in the same class. 39 | companion object { 40 | @JvmStatic 41 | fun registerWith(registrar: Registrar) { 42 | val channel = MethodChannel(registrar.messenger(), "open_mail_app") 43 | val plugin = OpenMailAppPlugin() 44 | channel.setMethodCallHandler(plugin) 45 | plugin.init(registrar.context()) 46 | } 47 | } 48 | 49 | fun init(context: Context) { 50 | applicationContext = context 51 | } 52 | 53 | override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { 54 | if (call.method == "openMailApp") { 55 | val opened = emailAppIntent(call.argument("nativePickerTitle") ?: "") 56 | result.success(opened) 57 | } else if (call.method == "openSpecificMailApp" && call.hasArgument("name")) { 58 | val opened = specificEmailAppIntent(call.argument("name")!!) 59 | result.success(opened) 60 | } else if (call.method == "composeNewEmailInMailApp") { 61 | val opened = composeNewEmailAppIntent(call.argument("nativePickerTitle") ?: "", call.argument("emailContent") ?: "") 62 | result.success(opened) 63 | } else if (call.method == "composeNewEmailInSpecificMailApp") { 64 | val opened = composeNewEmailInSpecificEmailAppIntent(call.argument("name") ?: "", call.argument("emailContent") ?: "") 65 | result.success(opened) 66 | } else if (call.method == "getMainApps") { 67 | val apps = getInstalledMailApps() 68 | val appsJson = Gson().toJson(apps) 69 | result.success(appsJson) 70 | } else { 71 | result.notImplemented() 72 | } 73 | } 74 | 75 | override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { 76 | channel.setMethodCallHandler(null) 77 | } 78 | 79 | private fun emailAppIntent(@NonNull chooserTitle: String): Boolean { 80 | val emailIntent = Intent(Intent.ACTION_VIEW, Uri.parse("mailto:")) 81 | val packageManager = applicationContext.packageManager 82 | 83 | val activitiesHandlingEmails = packageManager.queryIntentActivities(emailIntent, 0) 84 | if (activitiesHandlingEmails.isNotEmpty()) { 85 | // use the first email package to create the chooserIntent 86 | val firstEmailPackageName = activitiesHandlingEmails.first().activityInfo.packageName 87 | val firstEmailInboxIntent = packageManager.getLaunchIntentForPackage(firstEmailPackageName) 88 | val emailAppChooserIntent = Intent.createChooser(firstEmailInboxIntent, chooserTitle) 89 | 90 | // created UI for other email packages and add them to the chooser 91 | val emailInboxIntents = mutableListOf() 92 | for (i in 1 until activitiesHandlingEmails.size) { 93 | val activityHandlingEmail = activitiesHandlingEmails[i] 94 | val packageName = activityHandlingEmail.activityInfo.packageName 95 | packageManager.getLaunchIntentForPackage(packageName)?.let { intent -> 96 | emailInboxIntents.add( 97 | LabeledIntent( 98 | intent, 99 | packageName, 100 | activityHandlingEmail.loadLabel(packageManager), 101 | activityHandlingEmail.icon 102 | ) 103 | ) 104 | } 105 | } 106 | val extraEmailInboxIntents = emailInboxIntents.toTypedArray() 107 | val finalIntent = emailAppChooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, extraEmailInboxIntents) 108 | finalIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK 109 | applicationContext.startActivity(finalIntent) 110 | return true 111 | } else { 112 | return false 113 | } 114 | } 115 | 116 | private fun composeNewEmailAppIntent(@NonNull chooserTitle: String, @NonNull contentJson: String): Boolean { 117 | val packageManager = applicationContext.packageManager 118 | val emailContent = Gson().fromJson(contentJson, EmailContent::class.java) 119 | val emailIntent = Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:")) 120 | 121 | val activitiesHandlingEmails = packageManager.queryIntentActivities(emailIntent, 0) 122 | if (activitiesHandlingEmails.isNotEmpty()) { 123 | val emailAppChooserIntent = Intent.createChooser(Intent(Intent.ACTION_SENDTO).apply { 124 | data = Uri.parse("mailto:") 125 | type = "text/plain" 126 | setClassName(activitiesHandlingEmails.first().activityInfo.packageName, activitiesHandlingEmails.first().activityInfo.name) 127 | 128 | putExtra(Intent.EXTRA_EMAIL, emailContent.to.toTypedArray()) 129 | putExtra(Intent.EXTRA_CC, emailContent.cc.toTypedArray()) 130 | putExtra(Intent.EXTRA_BCC, emailContent.bcc.toTypedArray()) 131 | putExtra(Intent.EXTRA_SUBJECT, emailContent.subject) 132 | putExtra(Intent.EXTRA_TEXT, emailContent.body) 133 | }, chooserTitle) 134 | 135 | val emailComposingIntents = mutableListOf() 136 | for (i in 1 until activitiesHandlingEmails.size) { 137 | val activityHandlingEmail = activitiesHandlingEmails[i] 138 | val packageName = activityHandlingEmail.activityInfo.packageName 139 | emailComposingIntents.add( 140 | LabeledIntent( 141 | Intent(Intent.ACTION_SENDTO).apply { 142 | data = Uri.parse("mailto:") 143 | type = "text/plain" 144 | setClassName(activityHandlingEmail.activityInfo.packageName, activityHandlingEmail.activityInfo.name) 145 | putExtra(Intent.EXTRA_EMAIL, emailContent.to.toTypedArray()) 146 | putExtra(Intent.EXTRA_CC, emailContent.cc.toTypedArray()) 147 | putExtra(Intent.EXTRA_BCC, emailContent.bcc.toTypedArray()) 148 | putExtra(Intent.EXTRA_SUBJECT, emailContent.subject) 149 | putExtra(Intent.EXTRA_TEXT, emailContent.body) 150 | }, 151 | packageName, 152 | activityHandlingEmail.loadLabel(packageManager), 153 | activityHandlingEmail.icon 154 | ) 155 | ) 156 | } 157 | 158 | val extraEmailComposingIntents = emailComposingIntents.toTypedArray() 159 | val finalIntent = emailAppChooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, extraEmailComposingIntents) 160 | finalIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK 161 | applicationContext.startActivity(finalIntent) 162 | return true 163 | } else { 164 | return false 165 | } 166 | } 167 | 168 | private fun specificEmailAppIntent(name: String): Boolean { 169 | val emailIntent = Intent(Intent.ACTION_VIEW, Uri.parse("mailto:")) 170 | val packageManager = applicationContext.packageManager 171 | 172 | val activitiesHandlingEmails = packageManager.queryIntentActivities(emailIntent, 0) 173 | val activityHandlingEmail = activitiesHandlingEmails.firstOrNull { 174 | it.loadLabel(packageManager) == name 175 | } ?: return false 176 | 177 | val firstEmailPackageName = activityHandlingEmail.activityInfo.packageName 178 | val emailInboxIntent = packageManager.getLaunchIntentForPackage(firstEmailPackageName) 179 | ?: return false 180 | 181 | emailInboxIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK 182 | applicationContext.startActivity(emailInboxIntent) 183 | return true 184 | } 185 | 186 | private fun composeNewEmailInSpecificEmailAppIntent(@NonNull name: String, @NonNull contentJson: String): Boolean { 187 | val packageManager = applicationContext.packageManager 188 | val emailContent = Gson().fromJson(contentJson, EmailContent::class.java) 189 | val emailIntent = Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:")) 190 | 191 | val activitiesHandlingEmails = packageManager.queryIntentActivities(emailIntent, 0) 192 | val specificEmailActivity = activitiesHandlingEmails.firstOrNull { 193 | it.loadLabel(packageManager) == name 194 | } ?: return false 195 | 196 | val composeEmailIntent = Intent(Intent.ACTION_SENDTO).apply { 197 | data = Uri.parse("mailto:") 198 | type = "text/plain" 199 | setClassName(specificEmailActivity.activityInfo.packageName, specificEmailActivity.activityInfo.name) 200 | putExtra(Intent.EXTRA_EMAIL, emailContent.to.toTypedArray()) 201 | putExtra(Intent.EXTRA_CC, emailContent.cc.toTypedArray()) 202 | putExtra(Intent.EXTRA_BCC, emailContent.bcc.toTypedArray()) 203 | putExtra(Intent.EXTRA_SUBJECT, emailContent.subject) 204 | putExtra(Intent.EXTRA_TEXT, emailContent.body) 205 | } 206 | 207 | composeEmailIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK 208 | applicationContext.startActivity(composeEmailIntent) 209 | 210 | return true 211 | } 212 | 213 | private fun getInstalledMailApps(): List { 214 | val emailIntent = Intent(Intent.ACTION_VIEW, Uri.parse("mailto:")) 215 | val packageManager = applicationContext.packageManager 216 | val activitiesHandlingEmails = packageManager.queryIntentActivities(emailIntent, 0) 217 | 218 | return if (activitiesHandlingEmails.isNotEmpty()) { 219 | val mailApps = mutableListOf() 220 | for (i in 0 until activitiesHandlingEmails.size) { 221 | val activityHandlingEmail = activitiesHandlingEmails[i] 222 | mailApps.add(App(activityHandlingEmail.loadLabel(packageManager).toString())) 223 | } 224 | mailApps 225 | } else { 226 | emptyList() 227 | } 228 | } 229 | } 230 | 231 | data class App( 232 | @SerializedName("name") val name: String 233 | ) 234 | 235 | data class EmailContent ( 236 | 237 | @SerializedName("to") val to: List, 238 | @SerializedName("cc") val cc: List, 239 | @SerializedName("bcc") val bcc: List, 240 | @SerializedName("subject") val subject: String, 241 | @SerializedName("body") val body: String 242 | ) 243 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Exceptions to above rules. 44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 45 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: e6b34c2b5c96bb95325269a29a84e83ed8909b5f 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # open_mail_app_example 2 | 3 | Demonstrates how to use the open_mail_app plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.homex.open_mail_app_example" 47 | minSdkVersion flutter.minSdkVersion 48 | targetSdkVersion flutter.targetSdkVersion 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | dependencies { 67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 68 | } 69 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/homex/open_mail_app_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.homex.open_mail_app_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.0.4' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - open_mail_app (0.0.1): 4 | - Flutter 5 | - url_launcher_ios (0.0.1): 6 | - Flutter 7 | 8 | DEPENDENCIES: 9 | - Flutter (from `Flutter`) 10 | - open_mail_app (from `.symlinks/plugins/open_mail_app/ios`) 11 | - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) 12 | 13 | EXTERNAL SOURCES: 14 | Flutter: 15 | :path: Flutter 16 | open_mail_app: 17 | :path: ".symlinks/plugins/open_mail_app/ios" 18 | url_launcher_ios: 19 | :path: ".symlinks/plugins/url_launcher_ios/ios" 20 | 21 | SPEC CHECKSUMS: 22 | Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a 23 | open_mail_app: 794172f6a22cd16319d3ddaf45e945b2f74952b0 24 | url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de 25 | 26 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c 27 | 28 | COCOAPODS: 1.11.2 29 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 337545F23DAEC89F4C0D65AF /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE51B22471B0F8AD82979207 /* Pods_Runner.framework */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 00FA8B811F719699B57DD655 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 36 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 37 | 461104D126190BC07F357F29 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 38 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 39 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 41 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 42 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 43 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | CE162D6AE198BE50AD26AA75 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 49 | EE51B22471B0F8AD82979207 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 337545F23DAEC89F4C0D65AF /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 17AF4536B414A59C0C0FF519 /* Frameworks */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | EE51B22471B0F8AD82979207 /* Pods_Runner.framework */, 68 | ); 69 | name = Frameworks; 70 | sourceTree = ""; 71 | }; 72 | 9740EEB11CF90186004384FC /* Flutter */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 77 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 78 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 79 | ); 80 | name = Flutter; 81 | sourceTree = ""; 82 | }; 83 | 97C146E51CF9000F007C117D = { 84 | isa = PBXGroup; 85 | children = ( 86 | 9740EEB11CF90186004384FC /* Flutter */, 87 | 97C146F01CF9000F007C117D /* Runner */, 88 | 97C146EF1CF9000F007C117D /* Products */, 89 | CC164BA0203AFBC2C55611BA /* Pods */, 90 | 17AF4536B414A59C0C0FF519 /* Frameworks */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 97C146EF1CF9000F007C117D /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 97C146EE1CF9000F007C117D /* Runner.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 97C146F01CF9000F007C117D /* Runner */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 106 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 107 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 108 | 97C147021CF9000F007C117D /* Info.plist */, 109 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 110 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 111 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 112 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 113 | ); 114 | path = Runner; 115 | sourceTree = ""; 116 | }; 117 | CC164BA0203AFBC2C55611BA /* Pods */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 461104D126190BC07F357F29 /* Pods-Runner.debug.xcconfig */, 121 | 00FA8B811F719699B57DD655 /* Pods-Runner.release.xcconfig */, 122 | CE162D6AE198BE50AD26AA75 /* Pods-Runner.profile.xcconfig */, 123 | ); 124 | name = Pods; 125 | path = Pods; 126 | sourceTree = ""; 127 | }; 128 | /* End PBXGroup section */ 129 | 130 | /* Begin PBXNativeTarget section */ 131 | 97C146ED1CF9000F007C117D /* Runner */ = { 132 | isa = PBXNativeTarget; 133 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 134 | buildPhases = ( 135 | 6F6E92B1F581F0D30181299F /* [CP] Check Pods Manifest.lock */, 136 | 9740EEB61CF901F6004384FC /* Run Script */, 137 | 97C146EA1CF9000F007C117D /* Sources */, 138 | 97C146EB1CF9000F007C117D /* Frameworks */, 139 | 97C146EC1CF9000F007C117D /* Resources */, 140 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 141 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 142 | 8AFBCF1233E9D4EF469E2BF4 /* [CP] Embed Pods Frameworks */, 143 | ); 144 | buildRules = ( 145 | ); 146 | dependencies = ( 147 | ); 148 | name = Runner; 149 | productName = Runner; 150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 151 | productType = "com.apple.product-type.application"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | 97C146E61CF9000F007C117D /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastUpgradeCheck = 1300; 160 | ORGANIZATIONNAME = ""; 161 | TargetAttributes = { 162 | 97C146ED1CF9000F007C117D = { 163 | CreatedOnToolsVersion = 7.3.1; 164 | LastSwiftMigration = 1100; 165 | }; 166 | }; 167 | }; 168 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 169 | compatibilityVersion = "Xcode 9.3"; 170 | developmentRegion = en; 171 | hasScannedForEncodings = 0; 172 | knownRegions = ( 173 | en, 174 | Base, 175 | ); 176 | mainGroup = 97C146E51CF9000F007C117D; 177 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 178 | projectDirPath = ""; 179 | projectRoot = ""; 180 | targets = ( 181 | 97C146ED1CF9000F007C117D /* Runner */, 182 | ); 183 | }; 184 | /* End PBXProject section */ 185 | 186 | /* Begin PBXResourcesBuildPhase section */ 187 | 97C146EC1CF9000F007C117D /* Resources */ = { 188 | isa = PBXResourcesBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 193 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 194 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | /* End PBXResourcesBuildPhase section */ 199 | 200 | /* Begin PBXShellScriptBuildPhase section */ 201 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 202 | isa = PBXShellScriptBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | ); 206 | inputPaths = ( 207 | ); 208 | name = "Thin Binary"; 209 | outputPaths = ( 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | shellPath = /bin/sh; 213 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 214 | }; 215 | 6F6E92B1F581F0D30181299F /* [CP] Check Pods Manifest.lock */ = { 216 | isa = PBXShellScriptBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | ); 220 | inputFileListPaths = ( 221 | ); 222 | inputPaths = ( 223 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 224 | "${PODS_ROOT}/Manifest.lock", 225 | ); 226 | name = "[CP] Check Pods Manifest.lock"; 227 | outputFileListPaths = ( 228 | ); 229 | outputPaths = ( 230 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | shellPath = /bin/sh; 234 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 235 | showEnvVarsInLog = 0; 236 | }; 237 | 8AFBCF1233E9D4EF469E2BF4 /* [CP] Embed Pods Frameworks */ = { 238 | isa = PBXShellScriptBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | ); 242 | inputFileListPaths = ( 243 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 244 | ); 245 | name = "[CP] Embed Pods Frameworks"; 246 | outputFileListPaths = ( 247 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | shellPath = /bin/sh; 251 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 252 | showEnvVarsInLog = 0; 253 | }; 254 | 9740EEB61CF901F6004384FC /* Run Script */ = { 255 | isa = PBXShellScriptBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | inputPaths = ( 260 | ); 261 | name = "Run Script"; 262 | outputPaths = ( 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | shellPath = /bin/sh; 266 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 267 | }; 268 | /* End PBXShellScriptBuildPhase section */ 269 | 270 | /* Begin PBXSourcesBuildPhase section */ 271 | 97C146EA1CF9000F007C117D /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 276 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | /* End PBXSourcesBuildPhase section */ 281 | 282 | /* Begin PBXVariantGroup section */ 283 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 284 | isa = PBXVariantGroup; 285 | children = ( 286 | 97C146FB1CF9000F007C117D /* Base */, 287 | ); 288 | name = Main.storyboard; 289 | sourceTree = ""; 290 | }; 291 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 292 | isa = PBXVariantGroup; 293 | children = ( 294 | 97C147001CF9000F007C117D /* Base */, 295 | ); 296 | name = LaunchScreen.storyboard; 297 | sourceTree = ""; 298 | }; 299 | /* End PBXVariantGroup section */ 300 | 301 | /* Begin XCBuildConfiguration section */ 302 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_NONNULL = YES; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_MODULES = YES; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_COMMA = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INFINITE_RECURSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 326 | CLANG_WARN_STRICT_PROTOTYPES = YES; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 333 | ENABLE_NS_ASSERTIONS = NO; 334 | ENABLE_STRICT_OBJC_MSGSEND = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_NO_COMMON_BLOCKS = YES; 337 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 338 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 339 | GCC_WARN_UNDECLARED_SELECTOR = YES; 340 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 341 | GCC_WARN_UNUSED_FUNCTION = YES; 342 | GCC_WARN_UNUSED_VARIABLE = YES; 343 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 344 | MTL_ENABLE_DEBUG_INFO = NO; 345 | SDKROOT = iphoneos; 346 | SUPPORTED_PLATFORMS = iphoneos; 347 | TARGETED_DEVICE_FAMILY = "1,2"; 348 | VALIDATE_PRODUCT = YES; 349 | }; 350 | name = Profile; 351 | }; 352 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 353 | isa = XCBuildConfiguration; 354 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 355 | buildSettings = { 356 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 357 | CLANG_ENABLE_MODULES = YES; 358 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 359 | DEVELOPMENT_TEAM = 5WQXUJ2H76; 360 | ENABLE_BITCODE = NO; 361 | INFOPLIST_FILE = Runner/Info.plist; 362 | LD_RUNPATH_SEARCH_PATHS = ( 363 | "$(inherited)", 364 | "@executable_path/Frameworks", 365 | ); 366 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 367 | PRODUCT_NAME = "$(TARGET_NAME)"; 368 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 369 | SWIFT_VERSION = 5.0; 370 | VERSIONING_SYSTEM = "apple-generic"; 371 | }; 372 | name = Profile; 373 | }; 374 | 97C147031CF9000F007C117D /* Debug */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | ALWAYS_SEARCH_USER_PATHS = NO; 378 | CLANG_ANALYZER_NONNULL = YES; 379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 380 | CLANG_CXX_LIBRARY = "libc++"; 381 | CLANG_ENABLE_MODULES = YES; 382 | CLANG_ENABLE_OBJC_ARC = YES; 383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_COMMA = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 389 | CLANG_WARN_EMPTY_BODY = YES; 390 | CLANG_WARN_ENUM_CONVERSION = YES; 391 | CLANG_WARN_INFINITE_RECURSION = YES; 392 | CLANG_WARN_INT_CONVERSION = YES; 393 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 394 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 395 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 396 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 397 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 398 | CLANG_WARN_STRICT_PROTOTYPES = YES; 399 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 400 | CLANG_WARN_UNREACHABLE_CODE = YES; 401 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 402 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 403 | COPY_PHASE_STRIP = NO; 404 | DEBUG_INFORMATION_FORMAT = dwarf; 405 | ENABLE_STRICT_OBJC_MSGSEND = YES; 406 | ENABLE_TESTABILITY = YES; 407 | GCC_C_LANGUAGE_STANDARD = gnu99; 408 | GCC_DYNAMIC_NO_PIC = NO; 409 | GCC_NO_COMMON_BLOCKS = YES; 410 | GCC_OPTIMIZATION_LEVEL = 0; 411 | GCC_PREPROCESSOR_DEFINITIONS = ( 412 | "DEBUG=1", 413 | "$(inherited)", 414 | ); 415 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 416 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 417 | GCC_WARN_UNDECLARED_SELECTOR = YES; 418 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 419 | GCC_WARN_UNUSED_FUNCTION = YES; 420 | GCC_WARN_UNUSED_VARIABLE = YES; 421 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 422 | MTL_ENABLE_DEBUG_INFO = YES; 423 | ONLY_ACTIVE_ARCH = YES; 424 | SDKROOT = iphoneos; 425 | TARGETED_DEVICE_FAMILY = "1,2"; 426 | }; 427 | name = Debug; 428 | }; 429 | 97C147041CF9000F007C117D /* Release */ = { 430 | isa = XCBuildConfiguration; 431 | buildSettings = { 432 | ALWAYS_SEARCH_USER_PATHS = NO; 433 | CLANG_ANALYZER_NONNULL = YES; 434 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 435 | CLANG_CXX_LIBRARY = "libc++"; 436 | CLANG_ENABLE_MODULES = YES; 437 | CLANG_ENABLE_OBJC_ARC = YES; 438 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 439 | CLANG_WARN_BOOL_CONVERSION = YES; 440 | CLANG_WARN_COMMA = YES; 441 | CLANG_WARN_CONSTANT_CONVERSION = YES; 442 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 443 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 444 | CLANG_WARN_EMPTY_BODY = YES; 445 | CLANG_WARN_ENUM_CONVERSION = YES; 446 | CLANG_WARN_INFINITE_RECURSION = YES; 447 | CLANG_WARN_INT_CONVERSION = YES; 448 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 449 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 450 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 451 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 452 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 453 | CLANG_WARN_STRICT_PROTOTYPES = YES; 454 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 455 | CLANG_WARN_UNREACHABLE_CODE = YES; 456 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 457 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 458 | COPY_PHASE_STRIP = NO; 459 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 460 | ENABLE_NS_ASSERTIONS = NO; 461 | ENABLE_STRICT_OBJC_MSGSEND = YES; 462 | GCC_C_LANGUAGE_STANDARD = gnu99; 463 | GCC_NO_COMMON_BLOCKS = YES; 464 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 465 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 466 | GCC_WARN_UNDECLARED_SELECTOR = YES; 467 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 468 | GCC_WARN_UNUSED_FUNCTION = YES; 469 | GCC_WARN_UNUSED_VARIABLE = YES; 470 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 471 | MTL_ENABLE_DEBUG_INFO = NO; 472 | SDKROOT = iphoneos; 473 | SUPPORTED_PLATFORMS = iphoneos; 474 | SWIFT_COMPILATION_MODE = wholemodule; 475 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 476 | TARGETED_DEVICE_FAMILY = "1,2"; 477 | VALIDATE_PRODUCT = YES; 478 | }; 479 | name = Release; 480 | }; 481 | 97C147061CF9000F007C117D /* Debug */ = { 482 | isa = XCBuildConfiguration; 483 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 484 | buildSettings = { 485 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 486 | CLANG_ENABLE_MODULES = YES; 487 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 488 | DEVELOPMENT_TEAM = 5WQXUJ2H76; 489 | ENABLE_BITCODE = NO; 490 | INFOPLIST_FILE = Runner/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = ( 492 | "$(inherited)", 493 | "@executable_path/Frameworks", 494 | ); 495 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 496 | PRODUCT_NAME = "$(TARGET_NAME)"; 497 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 498 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 499 | SWIFT_VERSION = 5.0; 500 | VERSIONING_SYSTEM = "apple-generic"; 501 | }; 502 | name = Debug; 503 | }; 504 | 97C147071CF9000F007C117D /* Release */ = { 505 | isa = XCBuildConfiguration; 506 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 507 | buildSettings = { 508 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 509 | CLANG_ENABLE_MODULES = YES; 510 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 511 | DEVELOPMENT_TEAM = 5WQXUJ2H76; 512 | ENABLE_BITCODE = NO; 513 | INFOPLIST_FILE = Runner/Info.plist; 514 | LD_RUNPATH_SEARCH_PATHS = ( 515 | "$(inherited)", 516 | "@executable_path/Frameworks", 517 | ); 518 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 519 | PRODUCT_NAME = "$(TARGET_NAME)"; 520 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 521 | SWIFT_VERSION = 5.0; 522 | VERSIONING_SYSTEM = "apple-generic"; 523 | }; 524 | name = Release; 525 | }; 526 | /* End XCBuildConfiguration section */ 527 | 528 | /* Begin XCConfigurationList section */ 529 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 530 | isa = XCConfigurationList; 531 | buildConfigurations = ( 532 | 97C147031CF9000F007C117D /* Debug */, 533 | 97C147041CF9000F007C117D /* Release */, 534 | 249021D3217E4FDB00AE95B9 /* Profile */, 535 | ); 536 | defaultConfigurationIsVisible = 0; 537 | defaultConfigurationName = Release; 538 | }; 539 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 540 | isa = XCConfigurationList; 541 | buildConfigurations = ( 542 | 97C147061CF9000F007C117D /* Debug */, 543 | 97C147071CF9000F007C117D /* Release */, 544 | 249021D4217E4FDB00AE95B9 /* Profile */, 545 | ); 546 | defaultConfigurationIsVisible = 0; 547 | defaultConfigurationName = Release; 548 | }; 549 | /* End XCConfigurationList section */ 550 | }; 551 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 552 | } 553 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | open_mail_app_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | LSApplicationQueriesSchemes 45 | 46 | googlegmail 47 | x-dispatch 48 | readdle-spark 49 | airmail 50 | ms-outlook 51 | ymail 52 | fastmail 53 | protonmail 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:open_mail_app/open_mail_app.dart'; 3 | 4 | void main() { 5 | runApp(MaterialApp(home: MyApp())); 6 | } 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: Text("Open Mail App Example"), 14 | ), 15 | body: Center( 16 | child: Column( 17 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 18 | children: [ 19 | ElevatedButton( 20 | child: Text("Open Mail App"), 21 | onPressed: () async { 22 | // Android: Will open mail app or show native picker. 23 | // iOS: Will open mail app if single mail app found. 24 | var result = await OpenMailApp.openMailApp( 25 | nativePickerTitle: 'Select email app to open', 26 | ); 27 | 28 | // If no mail apps found, show error 29 | if (!result.didOpen && !result.canOpen) { 30 | showNoMailAppsDialog(context); 31 | 32 | // iOS: if multiple mail apps found, show dialog to select. 33 | // There is no native intent/default app system in iOS so 34 | // you have to do it yourself. 35 | } else if (!result.didOpen && result.canOpen) { 36 | showDialog( 37 | context: context, 38 | builder: (_) { 39 | return MailAppPickerDialog( 40 | mailApps: result.options, 41 | ); 42 | }, 43 | ); 44 | } 45 | }, 46 | ), 47 | ElevatedButton( 48 | child: Text('Open mail app, with email already composed'), 49 | onPressed: () async { 50 | EmailContent email = EmailContent( 51 | to: [ 52 | 'user@domain.com', 53 | ], 54 | subject: 'Hello!', 55 | body: 'How are you doing?', 56 | cc: ['user2@domain.com', 'user3@domain.com'], 57 | bcc: ['boss@domain.com'], 58 | ); 59 | 60 | OpenMailAppResult result = 61 | await OpenMailApp.composeNewEmailInMailApp( 62 | nativePickerTitle: 'Select email app to compose', 63 | emailContent: email); 64 | if (!result.didOpen && !result.canOpen) { 65 | showNoMailAppsDialog(context); 66 | } else if (!result.didOpen && result.canOpen) { 67 | showDialog( 68 | context: context, 69 | builder: (_) => MailAppPickerDialog( 70 | mailApps: result.options, 71 | emailContent: email, 72 | ), 73 | ); 74 | } 75 | }, 76 | ), 77 | ElevatedButton( 78 | child: Text("Get Mail Apps"), 79 | onPressed: () async { 80 | var apps = await OpenMailApp.getMailApps(); 81 | 82 | if (apps.isEmpty) { 83 | showNoMailAppsDialog(context); 84 | } else { 85 | showDialog( 86 | context: context, 87 | builder: (context) { 88 | return MailAppPickerDialog( 89 | mailApps: apps, 90 | emailContent: EmailContent( 91 | to: [ 92 | 'user@domain.com', 93 | ], 94 | subject: 'Hello!', 95 | body: 'How are you doing?', 96 | cc: ['user2@domain.com', 'user3@domain.com'], 97 | bcc: ['boss@domain.com'], 98 | ), 99 | ); 100 | }, 101 | ); 102 | } 103 | }, 104 | ), 105 | ], 106 | ), 107 | ), 108 | ); 109 | } 110 | 111 | void showNoMailAppsDialog(BuildContext context) { 112 | showDialog( 113 | context: context, 114 | builder: (context) { 115 | return AlertDialog( 116 | title: Text("Open Mail App"), 117 | content: Text("No mail apps installed"), 118 | actions: [ 119 | TextButton( 120 | child: Text("OK"), 121 | onPressed: () { 122 | Navigator.pop(context); 123 | }, 124 | ) 125 | ], 126 | ); 127 | }, 128 | ); 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: open_mail_app_example 2 | description: Demonstrates how to use the open_mail_app plugin. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | version: 1.0.0+1 9 | 10 | environment: 11 | sdk: ">=2.12.0 <3.0.0" 12 | 13 | dependencies: 14 | flutter: 15 | sdk: flutter 16 | 17 | open_mail_app: 18 | # When depending on this package from a real application you should use: 19 | # open_mail_app: ^x.y.z 20 | # See https://dart.dev/tools/pub/dependencies#version-constraints 21 | # The example app is bundled with the plugin so we use a path dependency on 22 | # the parent directory to use the current plugin's version. 23 | path: ../ 24 | 25 | # The following adds the Cupertino Icons font to your application. 26 | # Use with the CupertinoIcons class for iOS style icons. 27 | cupertino_icons: ^0.1.3 28 | 29 | dev_dependencies: 30 | flutter_test: 31 | sdk: flutter 32 | 33 | # For information on the generic Dart part of this file, see the 34 | # following page: https://dart.dev/tools/pub/pubspec 35 | 36 | # The following section is specific to Flutter. 37 | flutter: 38 | 39 | # The following line ensures that the Material Icons font is 40 | # included with your application, so that you can use the icons in 41 | # the material Icons class. 42 | uses-material-design: true 43 | 44 | # To add assets to your application, add an assets section, like this: 45 | # assets: 46 | # - images/a_dot_burr.jpeg 47 | # - images/a_dot_ham.jpeg 48 | 49 | # An image asset can refer to one or more resolution-specific "variants", see 50 | # https://flutter.dev/assets-and-images/#resolution-aware. 51 | 52 | # For details regarding adding assets from package dependencies, see 53 | # https://flutter.dev/assets-and-images/#from-packages 54 | 55 | # To add custom fonts to your application, add a fonts section here, 56 | # in this "flutter" section. Each entry in this list should have a 57 | # "family" key with the font family name, and a "fonts" key with a 58 | # list giving the asset and other descriptors for the font. For 59 | # example: 60 | # fonts: 61 | # - family: Schyler 62 | # fonts: 63 | # - asset: fonts/Schyler-Regular.ttf 64 | # - asset: fonts/Schyler-Italic.ttf 65 | # style: italic 66 | # - family: Trajan Pro 67 | # fonts: 68 | # - asset: fonts/TrajanPro.ttf 69 | # - asset: fonts/TrajanPro_Bold.ttf 70 | # weight: 700 71 | # 72 | # For details regarding fonts from package dependencies, 73 | # see https://flutter.dev/custom-fonts/#from-packages 74 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HomeX-It/open-mail-app-flutter/6cf758a853268e979ecaecfb78eb9d034ed0bdfe/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/OpenMailAppPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface OpenMailAppPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /ios/Classes/OpenMailAppPlugin.m: -------------------------------------------------------------------------------- 1 | #import "OpenMailAppPlugin.h" 2 | #if __has_include() 3 | #import 4 | #else 5 | // Support project import fallback if the generated compatibility header 6 | // is not copied when this plugin is created as a library. 7 | // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 8 | #import "open_mail_app-Swift.h" 9 | #endif 10 | 11 | @implementation OpenMailAppPlugin 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | [SwiftOpenMailAppPlugin registerWithRegistrar:registrar]; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /ios/Classes/SwiftOpenMailAppPlugin.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | 4 | public class SwiftOpenMailAppPlugin: NSObject, FlutterPlugin { 5 | public static func register(with registrar: FlutterPluginRegistrar) { 6 | let channel = FlutterMethodChannel(name: "open_mail_app", binaryMessenger: registrar.messenger()) 7 | let instance = SwiftOpenMailAppPlugin() 8 | registrar.addMethodCallDelegate(instance, channel: channel) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ios/open_mail_app.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint open_mail_app.podspec' to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'open_mail_app' 7 | s.version = '0.0.1' 8 | s.summary = 'A new flutter plugin project.' 9 | s.description = <<-DESC 10 | A new flutter plugin project. 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.dependency 'Flutter' 18 | s.platform = :ios, '8.0' 19 | 20 | # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. 21 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } 22 | s.swift_version = '5.0' 23 | end 24 | -------------------------------------------------------------------------------- /lib/open_mail_app.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:platform/platform.dart'; 6 | import 'package:url_launcher/url_launcher.dart'; 7 | 8 | /// Launch Schemes for supported apps: 9 | const String _LAUNCH_SCHEME_APPLE_MAIL = 'message://'; 10 | const String _LAUNCH_SCHEME_GMAIL = 'googlegmail://'; 11 | const String _LAUNCH_SCHEME_DISPATCH = 'x-dispatch://'; 12 | const String _LAUNCH_SCHEME_SPARK = 'readdle-spark://'; 13 | const String _LAUNCH_SCHEME_AIRMAIL = 'airmail://'; 14 | const String _LAUNCH_SCHEME_OUTLOOK = 'ms-outlook://'; 15 | const String _LAUNCH_SCHEME_YAHOO = 'ymail://'; 16 | const String _LAUNCH_SCHEME_FASTMAIL = 'fastmail://'; 17 | const String _LAUNCH_SCHEME_SUPERHUMAN = 'superhuman://'; 18 | const String _LAUNCH_SCHEME_PROTONMAIL = 'protonmail://'; 19 | 20 | /// Provides ability to query device for installed email apps and open those 21 | /// apps 22 | class OpenMailApp { 23 | OpenMailApp._(); 24 | 25 | @visibleForTesting 26 | static Platform platform = LocalPlatform(); 27 | 28 | static bool get _isAndroid => platform.isAndroid; 29 | 30 | static bool get _isIOS => platform.isIOS; 31 | 32 | static const MethodChannel _channel = const MethodChannel('open_mail_app'); 33 | static List _filterList = ['paypal']; 34 | static List _supportedMailApps = [ 35 | MailApp( 36 | name: 'Apple Mail', 37 | iosLaunchScheme: _LAUNCH_SCHEME_APPLE_MAIL, 38 | composeData: ComposeData( 39 | base: 'mailto:', 40 | ), 41 | ), 42 | MailApp( 43 | name: 'Gmail', 44 | iosLaunchScheme: _LAUNCH_SCHEME_GMAIL, 45 | composeData: ComposeData( 46 | base: _LAUNCH_SCHEME_GMAIL + '/co', 47 | ), 48 | ), 49 | MailApp( 50 | name: 'Dispatch', 51 | iosLaunchScheme: _LAUNCH_SCHEME_DISPATCH, 52 | composeData: ComposeData( 53 | base: _LAUNCH_SCHEME_DISPATCH + '/compose', 54 | ), 55 | ), 56 | MailApp( 57 | name: 'Spark', 58 | iosLaunchScheme: _LAUNCH_SCHEME_SPARK, 59 | composeData: ComposeData( 60 | base: _LAUNCH_SCHEME_SPARK + 'compose', 61 | to: 'recipient', 62 | ), 63 | ), 64 | MailApp( 65 | name: 'Airmail', 66 | iosLaunchScheme: _LAUNCH_SCHEME_AIRMAIL, 67 | composeData: ComposeData( 68 | base: _LAUNCH_SCHEME_AIRMAIL + 'compose', 69 | body: 'plainBody', 70 | ), 71 | ), 72 | MailApp( 73 | name: 'Outlook', 74 | iosLaunchScheme: _LAUNCH_SCHEME_OUTLOOK, 75 | composeData: ComposeData( 76 | base: _LAUNCH_SCHEME_OUTLOOK + 'compose', 77 | ), 78 | ), 79 | MailApp( 80 | name: 'Yahoo', 81 | iosLaunchScheme: _LAUNCH_SCHEME_YAHOO, 82 | composeData: ComposeData( 83 | base: _LAUNCH_SCHEME_YAHOO + 'mail/compose', 84 | ), 85 | ), 86 | MailApp( 87 | name: 'Fastmail', 88 | iosLaunchScheme: _LAUNCH_SCHEME_FASTMAIL, 89 | composeData: ComposeData( 90 | base: _LAUNCH_SCHEME_FASTMAIL + 'mail/compose', 91 | ), 92 | ), 93 | MailApp( 94 | name: 'Superhuman', 95 | iosLaunchScheme: _LAUNCH_SCHEME_SUPERHUMAN, 96 | composeData: ComposeData(), 97 | ), 98 | MailApp( 99 | name: 'ProtonMail', 100 | iosLaunchScheme: _LAUNCH_SCHEME_PROTONMAIL, 101 | composeData: ComposeData( 102 | base: _LAUNCH_SCHEME_PROTONMAIL + 'mailto:', 103 | ), 104 | ), 105 | ]; 106 | 107 | /// Attempts to open an email app installed on the device. 108 | /// 109 | /// Android: Will open mail app or show native picker if multiple. 110 | /// 111 | /// iOS: Will open mail app if single installed mail app is found. If multiple 112 | /// are found will return a [OpenMailAppResult] that contains list of 113 | /// [MailApp]s. This can be used along with [MailAppPickerDialog] to allow 114 | /// the user to pick the mail app they want to open. 115 | /// 116 | /// Also see [openSpecificMailApp] and [getMailApps] for other use cases. 117 | /// 118 | /// Android: [nativePickerTitle] will set the title of the native picker. 119 | static Future openMailApp({ 120 | String nativePickerTitle = '', 121 | }) async { 122 | if (_isAndroid) { 123 | final result = await _channel.invokeMethod( 124 | 'openMailApp', 125 | {'nativePickerTitle': nativePickerTitle}, 126 | ) ?? 127 | false; 128 | return OpenMailAppResult(didOpen: result); 129 | } else if (_isIOS) { 130 | final apps = await _getIosMailApps(); 131 | if (apps.length == 1) { 132 | final result = await launch( 133 | apps.first.iosLaunchScheme, 134 | forceSafariVC: false, 135 | ); 136 | return OpenMailAppResult(didOpen: result); 137 | } else { 138 | return OpenMailAppResult(didOpen: false, options: apps); 139 | } 140 | } else { 141 | throw Exception('Platform not supported'); 142 | } 143 | } 144 | 145 | /// Allows you to open a mail application installed on the user's device 146 | /// and start composing a new email with the contents in [emailContent]. 147 | /// 148 | /// [EmailContent] Provides content for the email you're composing 149 | /// [String] (android) sets the title of the native picker. 150 | /// throws an [Exception] if you're launching from an unsupported platform. 151 | static Future composeNewEmailInMailApp({ 152 | String nativePickerTitle = '', 153 | required EmailContent emailContent, 154 | }) async { 155 | if (_isAndroid) { 156 | final result = await _channel.invokeMethod( 157 | 'composeNewEmailInMailApp', 158 | { 159 | 'nativePickerTitle': nativePickerTitle, 160 | 'emailContent': emailContent.toJson(), 161 | }, 162 | ) ?? 163 | false; 164 | 165 | return OpenMailAppResult(didOpen: result); 166 | } else if (_isIOS) { 167 | List installedApps = await _getIosMailApps(); 168 | if (installedApps.length == 1) { 169 | bool result = false; 170 | String? launchScheme = 171 | installedApps.first.composeLaunchScheme(emailContent); 172 | if (launchScheme != null) { 173 | result = await launch( 174 | launchScheme, 175 | forceSafariVC: false, 176 | ); 177 | } 178 | return OpenMailAppResult(didOpen: result); 179 | } else { 180 | // This isn't ideal since you can't do anything with this... 181 | // Need to adapt the flow with that popup to also allow to pass emailcontent there. 182 | return OpenMailAppResult(didOpen: false, options: installedApps); 183 | } 184 | } else { 185 | throw Exception('Platform currently not supported.'); 186 | } 187 | } 188 | 189 | /// Allows you to compose a new email in the specified [mailApp] witht the 190 | /// contents from [emailContent] 191 | /// 192 | /// [MailApp] (required) the maill app you wish to launch. Get it by calling [getMailApps] 193 | /// [EmailContent] provides content for the email you're composing 194 | /// throws an [Exception] if you're launching from an unsupported platform. 195 | static Future composeNewEmailInSpecificMailApp({ 196 | required MailApp mailApp, 197 | required EmailContent emailContent, 198 | }) async { 199 | if (_isAndroid) { 200 | final result = await _channel.invokeMethod( 201 | 'composeNewEmailInSpecificMailApp', 202 | { 203 | 'name': mailApp.name, 204 | 'emailContent': emailContent.toJson(), 205 | }, 206 | ) ?? 207 | false; 208 | return result; 209 | } else if (_isIOS) { 210 | String? launchScheme = mailApp.composeLaunchScheme(emailContent); 211 | if (launchScheme != null) { 212 | return await launch( 213 | launchScheme, 214 | forceSafariVC: false, 215 | ); 216 | } 217 | 218 | return false; 219 | } else { 220 | throw Exception('Platform currently not supported'); 221 | } 222 | } 223 | 224 | /// Attempts to open a specific email app installed on the device. 225 | /// Get a [MailApp] from calling [getMailApps] 226 | static Future openSpecificMailApp(MailApp mailApp) async { 227 | if (_isAndroid) { 228 | var result = await _channel.invokeMethod( 229 | 'openSpecificMailApp', 230 | {'name': mailApp.name}, 231 | ) ?? 232 | false; 233 | return result; 234 | } else if (_isIOS) { 235 | return await launch( 236 | mailApp.iosLaunchScheme, 237 | forceSafariVC: false, 238 | ); 239 | } else { 240 | throw Exception('Platform not supported'); 241 | } 242 | } 243 | 244 | /// Returns a list of installed email apps on the device 245 | /// 246 | /// iOS: [MailApp.iosLaunchScheme] will be populated 247 | static Future> getMailApps() async { 248 | if (_isAndroid) { 249 | return await _getAndroidMailApps(); 250 | } else if (_isIOS) { 251 | return await _getIosMailApps(); 252 | } else { 253 | throw Exception('Platform not supported'); 254 | } 255 | } 256 | 257 | static Future> _getAndroidMailApps() async { 258 | var appsJson = await _channel.invokeMethod('getMainApps'); 259 | var apps = []; 260 | 261 | if (appsJson != null) { 262 | apps = (jsonDecode(appsJson) as Iterable) 263 | .map((x) => MailApp.fromJson(x)) 264 | .where((app) => !_filterList.contains(app.name.toLowerCase())) 265 | .toList(); 266 | } 267 | 268 | return apps; 269 | } 270 | 271 | static Future> _getIosMailApps() async { 272 | var installedApps = []; 273 | for (var app in _supportedMailApps) { 274 | if (await canLaunch(app.iosLaunchScheme) && 275 | !_filterList.contains(app.name.toLowerCase())) { 276 | installedApps.add(app); 277 | } 278 | } 279 | return installedApps; 280 | } 281 | 282 | /// Clears existing filter list and sets the filter list to the passed values. 283 | /// Filter list is case insensitive. Listed apps will be excluded from the results 284 | /// of `getMailApps` by name. 285 | /// 286 | /// Default filter list includes PayPal, since it implements the mailto: intent-filter 287 | /// on Android, but the intention of this plugin is to provide 288 | /// a utility for finding and opening apps dedicated to sending/receiving email. 289 | static void setFilterList(List filterList) { 290 | _filterList = filterList.map((e) => e.toLowerCase()).toList(); 291 | } 292 | } 293 | 294 | /// A simple dialog for allowing the user to pick and open an email app 295 | /// Use with [OpenMailApp.getMailApps] or [OpenMailApp.openMailApp] to get a 296 | /// list of mail apps installed on the device. 297 | class MailAppPickerDialog extends StatelessWidget { 298 | /// The title of the dialog 299 | final String title; 300 | 301 | /// The mail apps for the dialog to provide as options 302 | final List mailApps; 303 | final EmailContent? emailContent; 304 | 305 | const MailAppPickerDialog({ 306 | Key? key, 307 | this.title = 'Choose Mail App', 308 | required this.mailApps, 309 | this.emailContent, 310 | }) : super(key: key); 311 | 312 | @override 313 | Widget build(BuildContext context) { 314 | return SimpleDialog( 315 | title: Text(title), 316 | children: [ 317 | for (var app in mailApps) 318 | SimpleDialogOption( 319 | child: Text(app.name), 320 | onPressed: () { 321 | final content = this.emailContent; 322 | if (content != null) { 323 | OpenMailApp.composeNewEmailInSpecificMailApp( 324 | mailApp: app, 325 | emailContent: content, 326 | ); 327 | } else { 328 | OpenMailApp.openSpecificMailApp(app); 329 | } 330 | 331 | Navigator.pop(context); 332 | }, 333 | ), 334 | ], 335 | ); 336 | } 337 | } 338 | 339 | class ComposeData { 340 | String base; 341 | String to; 342 | String cc; 343 | String bcc; 344 | String subject; 345 | String body; 346 | bool composeStarted = false; 347 | 348 | String get qsPairSeparator { 349 | String separator = !composeStarted ? '?' : '&'; 350 | composeStarted = true; 351 | return separator; 352 | } 353 | 354 | ComposeData({ 355 | this.base = 'mailto:', 356 | this.to = 'to', 357 | this.cc = 'cc', 358 | this.bcc = 'bcc', 359 | this.subject = 'subject', 360 | this.body = 'body', 361 | }); 362 | 363 | String getComposeLaunchSchemeForIos(EmailContent content) { 364 | String scheme = base; 365 | 366 | if (content.to.isNotEmpty) { 367 | scheme += '$qsPairSeparator$to=${content.to.join(',')}'; 368 | } 369 | 370 | if (content.cc.isNotEmpty) { 371 | scheme += '$qsPairSeparator$cc=${content.cc.join(',')}'; 372 | } 373 | 374 | if (content.bcc.isNotEmpty) { 375 | scheme += '$qsPairSeparator$bcc=${content.bcc.join(',')}'; 376 | } 377 | 378 | if (content.subject.isNotEmpty) { 379 | scheme += '$qsPairSeparator$subject=${content.subject}'; 380 | } 381 | 382 | if (content.body.isNotEmpty) { 383 | scheme += '$qsPairSeparator$body=${content.body}'; 384 | } 385 | 386 | // Reset to make sure you can fetch this multiple times on the same instance. 387 | composeStarted = false; 388 | 389 | return scheme; 390 | } 391 | 392 | @override 393 | String toString() { 394 | return this.getComposeLaunchSchemeForIos(EmailContent()); 395 | } 396 | } 397 | 398 | class MailApp { 399 | final String name; 400 | final String iosLaunchScheme; 401 | final ComposeData? composeData; 402 | 403 | const MailApp({ 404 | required this.name, 405 | required this.iosLaunchScheme, 406 | this.composeData, 407 | }); 408 | 409 | factory MailApp.fromJson(Map json) => MailApp( 410 | name: json["name"], 411 | iosLaunchScheme: json["iosLaunchScheme"] ?? '', 412 | composeData: json["composeData"] ?? ComposeData(), 413 | ); 414 | 415 | Map toJson() => { 416 | "name": name, 417 | "iosLaunchScheme": iosLaunchScheme, 418 | "composeData": composeData, 419 | }; 420 | 421 | String? composeLaunchScheme(EmailContent content) { 422 | if (OpenMailApp._isAndroid) { 423 | return content.toJson(); 424 | } else if (OpenMailApp._isIOS) { 425 | return this.composeData!.getComposeLaunchSchemeForIos(content); 426 | } else { 427 | throw Exception('Platform not supported'); 428 | } 429 | } 430 | } 431 | 432 | /// Result of calling [OpenMailApp.openMailApp] 433 | /// 434 | /// [options] and [canOpen] are only populated and used on iOS 435 | class OpenMailAppResult { 436 | final bool didOpen; 437 | final List options; 438 | 439 | bool get canOpen => options.isNotEmpty; 440 | 441 | OpenMailAppResult({ 442 | required this.didOpen, 443 | this.options = const [], 444 | }); 445 | } 446 | 447 | /// Used to populate the precomposed emails 448 | /// 449 | /// [to] List of [String] Addressees, 450 | /// [cc] Carbon Copy [String] list 451 | /// [bcc] Blind carbon copy [String] list 452 | /// [subject] [String], getter returns [Uri.encodeComponent] from the set [String] 453 | /// [body] [String], getter returns [Uri.encodeComponent] from the set [String] 454 | class EmailContent { 455 | final List to; 456 | final List cc; 457 | final List bcc; 458 | final String _subject; 459 | 460 | String get subject => 461 | OpenMailApp._isIOS ? Uri.encodeComponent(_subject) : _subject; 462 | final String _body; 463 | 464 | String get body => OpenMailApp._isIOS ? Uri.encodeComponent(_body) : _body; 465 | 466 | EmailContent({ 467 | List? to, 468 | List? cc, 469 | List? bcc, 470 | String? subject, 471 | String? body, 472 | }) : this.to = to ?? const [], 473 | this.cc = cc ?? const [], 474 | this.bcc = bcc ?? const [], 475 | this._subject = subject ?? '', 476 | this._body = body ?? ''; 477 | 478 | String toJson() { 479 | final Map emailContent = { 480 | 'to': this.to, 481 | 'cc': this.cc, 482 | 'bcc': this.bcc, 483 | 'subject': this.subject, 484 | 'body': this.body, 485 | }; 486 | 487 | return json.encode(emailContent); 488 | } 489 | } 490 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: open_mail_app 2 | description: This library provides the ability to query the device for installed email apps and open those apps 3 | version: 0.4.4 4 | homepage: https://github.com/HomeXLabs/open-mail-app-flutter 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | flutter: ">=1.12.0" 9 | 10 | dependencies: 11 | platform: ^3.1.0 12 | url_launcher: ^6.0.2 13 | flutter: 14 | sdk: flutter 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | 20 | flutter: 21 | plugin: 22 | platforms: 23 | android: 24 | package: com.homex.open_mail_app 25 | pluginClass: OpenMailAppPlugin 26 | ios: 27 | pluginClass: OpenMailAppPlugin 28 | -------------------------------------------------------------------------------- /test/open_mail_app_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:open_mail_app/open_mail_app.dart'; 4 | import 'package:platform/platform.dart'; 5 | 6 | void main() { 7 | TestWidgetsFlutterBinding.ensureInitialized(); 8 | 9 | const channel = MethodChannel('open_mail_app'); 10 | final log = []; 11 | 12 | channel.setMockMethodCallHandler((MethodCall methodCall) async { 13 | log.add(methodCall); 14 | if (methodCall.method == 'openMailApp') { 15 | return true; 16 | } 17 | return null; 18 | }); 19 | 20 | tearDown(() { 21 | log.clear(); 22 | }); 23 | 24 | test('openMailApp Android', () async { 25 | OpenMailApp.platform = FakePlatform(operatingSystem: Platform.android); 26 | final result = await OpenMailApp.openMailApp(); 27 | expect(result.didOpen, true); 28 | expect( 29 | log, 30 | [ 31 | isMethodCall('openMailApp', arguments: {'nativePickerTitle': ''}), 32 | ], 33 | ); 34 | }); 35 | } 36 | --------------------------------------------------------------------------------