File tree Expand file tree Collapse file tree 11 files changed +52
-8
lines changed Expand file tree Collapse file tree 11 files changed +52
-8
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.0.3
2
+
3
+ - Hotfix on 2.0.2, improved solution.
4
+
1
5
## 2.0.2
2
6
3
7
- Fixes: share URL is constructed incorrectly #235
Original file line number Diff line number Diff line change @@ -20,9 +20,13 @@ class ShareLinux extends SharePlatform {
20
20
'body' : text,
21
21
};
22
22
23
+ // see https://github.com/dart-lang/sdk/issues/43838#issuecomment-823551891
23
24
final uri = Uri (
24
25
scheme: 'mailto' ,
25
- queryParameters: queryParameters,
26
+ query: queryParameters.entries
27
+ .map ((e) =>
28
+ '${Uri .encodeComponent (e .key )}=${Uri .encodeComponent (e .value )}' )
29
+ .join ('&' ),
26
30
);
27
31
28
32
if (await canLaunch (uri.toString ())) {
Original file line number Diff line number Diff line change 1
1
name : share_plus_linux
2
2
description : Linux implementation of the share_plus plugin
3
- version : 2.0.2
3
+ version : 2.0.3
4
4
homepage : https://plus.fluttercommunity.dev/
5
5
repository : https://github.com/fluttercommunity/plus_plugins/tree/main/packages/
6
6
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import 'package:url_launcher_platform_interface/url_launcher_platform_interface.
4
4
import 'package:url_launcher_platform_interface/link.dart' ;
5
5
6
6
void main () {
7
- test ('url encoding is correct' , () async {
7
+ test ('url encoding is correct for & ' , () async {
8
8
final mock = MockUrlLauncherPlatform ();
9
9
UrlLauncherPlatform .instance = mock;
10
10
@@ -13,6 +13,16 @@ void main() {
13
13
expect (mock.url, 'mailto:?subject=bar%26foo&body=foo%26bar' );
14
14
});
15
15
16
+ // see https://github.com/dart-lang/sdk/issues/43838#issuecomment-823551891
17
+ test ('url encoding is correct for spaces' , () async {
18
+ final mock = MockUrlLauncherPlatform ();
19
+ UrlLauncherPlatform .instance = mock;
20
+
21
+ await ShareLinux ().share ('foo bar' , subject: 'bar foo' );
22
+
23
+ expect (mock.url, 'mailto:?subject=bar%20foo&body=foo%20bar' );
24
+ });
25
+
16
26
test ('throws when url_launcher can\' t launch uri' , () async {
17
27
final mock = MockUrlLauncherPlatform ();
18
28
mock.canLaunchMockValue = false ;
Original file line number Diff line number Diff line change
1
+ ## 2.0.4
2
+
3
+ - Hotfix on 2.0.3, improved solution.
4
+
1
5
## 2.0.3
2
6
3
7
- Fix #235 : share URL is constructed incorrectly
Original file line number Diff line number Diff line change @@ -35,9 +35,13 @@ class SharePlusPlugin extends SharePlatform {
35
35
'body' : text,
36
36
};
37
37
38
+ // see https://github.com/dart-lang/sdk/issues/43838#issuecomment-823551891
38
39
final uri = Uri (
39
40
scheme: 'mailto' ,
40
- queryParameters: queryParameters,
41
+ query: queryParameters.entries
42
+ .map ((e) =>
43
+ '${Uri .encodeComponent (e .key )}=${Uri .encodeComponent (e .value )}' )
44
+ .join ('&' ),
41
45
);
42
46
43
47
if (await canLaunch (uri.toString ())) {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: share_plus_web
2
2
description : Web platform implementation of share_plus
3
3
homepage : https://plus.fluttercommunity.dev/
4
4
repository : https://github.com/fluttercommunity/plus_plugins/tree/main/packages/
5
- version : 2.0.3
5
+ version : 2.0.4
6
6
7
7
flutter :
8
8
plugin :
Original file line number Diff line number Diff line change
1
+ ## 2.0.3
2
+
3
+ - Hotfix on 2.0.2, improved solution.
4
+
1
5
## 2.0.2
2
6
3
7
- Fixes: share URL is constructed incorrectly #235
Original file line number Diff line number Diff line change @@ -20,9 +20,13 @@ class ShareWindows extends SharePlatform {
20
20
'body' : text,
21
21
};
22
22
23
+ // see https://github.com/dart-lang/sdk/issues/43838#issuecomment-823551891
23
24
final uri = Uri (
24
25
scheme: 'mailto' ,
25
- queryParameters: queryParameters,
26
+ query: queryParameters.entries
27
+ .map ((e) =>
28
+ '${Uri .encodeComponent (e .key )}=${Uri .encodeComponent (e .value )}' )
29
+ .join ('&' ),
26
30
);
27
31
28
32
if (await canLaunch (uri.toString ())) {
Original file line number Diff line number Diff line change 1
1
name : share_plus_windows
2
2
description : Windows implementation of the share_plus plugin
3
- version : 2.0.2
3
+ version : 2.0.3
4
4
homepage : https://plus.fluttercommunity.dev/
5
5
repository : https://github.com/fluttercommunity/plus_plugins/tree/main/packages/
6
6
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import 'package:url_launcher_platform_interface/url_launcher_platform_interface.
4
4
import 'package:url_launcher_platform_interface/link.dart' ;
5
5
6
6
void main () {
7
- test ('url encoding is correct' , () async {
7
+ test ('url encoding is correct for & ' , () async {
8
8
final mock = MockUrlLauncherPlatform ();
9
9
UrlLauncherPlatform .instance = mock;
10
10
@@ -13,6 +13,16 @@ void main() {
13
13
expect (mock.url, 'mailto:?subject=bar%26foo&body=foo%26bar' );
14
14
});
15
15
16
+ // see https://github.com/dart-lang/sdk/issues/43838#issuecomment-823551891
17
+ test ('url encoding is correct for spaces' , () async {
18
+ final mock = MockUrlLauncherPlatform ();
19
+ UrlLauncherPlatform .instance = mock;
20
+
21
+ await ShareWindows ().share ('foo bar' , subject: 'bar foo' );
22
+
23
+ expect (mock.url, 'mailto:?subject=bar%20foo&body=foo%20bar' );
24
+ });
25
+
16
26
test ('throws when url_launcher can\' t launch uri' , () async {
17
27
final mock = MockUrlLauncherPlatform ();
18
28
mock.canLaunchMockValue = false ;
You can’t perform that action at this time.
0 commit comments