1

I had integrated a mail to scheme in flutter using a url_launcher package. the subject and body were given as query parameters.

 final Uri _emailLaunchUri = Uri(
                  scheme: 'mailto',
                  path: 'mail@qapp.how',
                  queryParameters: {
                      'body':
                          'this is sample text'
                    } 
                );

This will give the text as this+is+sample+text in mail.

Shibin
  • 3
  • 1
Abhijith K
  • 3,090
  • 4
  • 19
  • 43
  • I encountered a similar problem in MATLAB which lead me to the question here: https://stackoverflow.com/questions/4737841/urlencoder-not-able-to-translate-space-character . Turns out the + character is a cannonical space character representation in encoded URIs – Col Bates - collynomial Apr 29 '21 at 13:04

1 Answers1

1

instead of queryParameters use query.

final Uri _emailLaunchUri = Uri(
                  scheme: 'mailto',
                  path: 'mail@qapp.how',
                  query:
                       'body=this is sample text',
                );
Abhijith K
  • 3,090
  • 4
  • 19
  • 43