2
mailto:<email address>?subject=<subject>&body=<body>

This one creates an email. I want to just open the Gmail app (inbox) with url_launcher package. Is it possible?

Balaji
  • 1,773
  • 1
  • 17
  • 30

4 Answers4

1

You can simple use

launch("https://mail.google.com/mail/u/0/#inbox")

This will open the inbox

Siddharth Agrawal
  • 2,960
  • 3
  • 16
  • 37
0

You can use external dependency to open any app or playstore directly.

https://pub.dev/packages/external_app_launcher

AK Ali
  • 152
  • 1
  • 6
0

currently launch() is deprecated, instead use launchUrl(). below _inputController is text field controller

final Uri params = Uri(
  scheme: 'mailto',
  path: 'abcd@gmail.com',
  query: 'subject=emails&body=${_inputController.text}',
);
final url = params.toString();
final urlPath = Uri.parse(url);
launchUrl(urlPath);
John
  • 1
  • 1
-1

Yes, it is possible with the url_launcher package.

To open the gmail app (inbox) with pre-filled mailto, subject and body, you can do something like this:

final Uri params = Uri(
  scheme: 'mailto',
  path: 'mailto@gmail.com',
  query: 'subject=This is the subject&body=this is body',
);
final url = params.toString();
launch(url);