File tree Expand file tree Collapse file tree 5 files changed +19
-33
lines changed Expand file tree Collapse file tree 5 files changed +19
-33
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.0.0-nullsafety
2
+
3
+ * Migrate to null safety.
4
+
1
5
## 0.6.5+5
2
6
3
7
* Update Flutter SDK constraint.
Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ class Share {
33
33
/// from [MethodChannel] .
34
34
static Future <void > share (
35
35
String text, {
36
- String subject,
37
- Rect sharePositionOrigin,
36
+ String ? subject,
37
+ Rect ? sharePositionOrigin,
38
38
}) {
39
39
assert (text != null );
40
40
assert (text.isNotEmpty);
@@ -67,10 +67,10 @@ class Share {
67
67
/// from [MethodChannel] .
68
68
static Future <void > shareFiles (
69
69
List <String > paths, {
70
- List <String > mimeTypes,
71
- String subject,
72
- String text,
73
- Rect sharePositionOrigin,
70
+ List <String >? mimeTypes,
71
+ String ? subject,
72
+ String ? text,
73
+ Rect ? sharePositionOrigin,
74
74
}) {
75
75
assert (paths != null );
76
76
assert (paths.isNotEmpty);
Original file line number Diff line number Diff line change @@ -2,10 +2,7 @@ name: share
2
2
description : Flutter plugin for sharing content via the platform share UI, using
3
3
the ACTION_SEND intent on Android and UIActivityViewController on iOS.
4
4
homepage : https://github.com/flutter/plugins/tree/master/packages/share
5
- # 0.6.y+z is compatible with 1.0.0, if you land a breaking change bump
6
- # the version to 2.0.0.
7
- # See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0
8
- version : 0.6.5+5
5
+ version : 2.0.0-nullsafety
9
6
10
7
flutter :
11
8
plugin :
@@ -17,20 +14,20 @@ flutter:
17
14
pluginClass : FLTSharePlugin
18
15
19
16
dependencies :
20
- meta : ^1.0.5
21
- mime : ^0.9.7
17
+ meta : ^1.3.0-nullsafety.6
18
+ mime : ^1.0.0-nullsafety.0
22
19
flutter :
23
20
sdk : flutter
24
21
25
22
dev_dependencies :
26
- test : ^1.3.0
27
- mockito : ^3.0.0
23
+ test : ^1.16.0-nullsafety.13
24
+ mockito : ^4.1.3
28
25
flutter_test :
29
26
sdk : flutter
30
27
integration_test :
31
28
path : ../integration_test
32
- pedantic : ^1.8.0
29
+ pedantic : ^1.10.0-nullsafety.3
33
30
34
31
environment :
35
- sdk : " >=2.1.0 <3.0.0"
36
32
flutter : " >=1.12.13+hotfix.5"
33
+ sdk : " >=2.12.0-0 <3.0.0"
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import 'package:flutter/services.dart';
15
15
void main () {
16
16
TestWidgetsFlutterBinding .ensureInitialized ();
17
17
18
- MockMethodChannel mockChannel;
18
+ late MockMethodChannel mockChannel;
19
19
20
20
setUp (() {
21
21
mockChannel = MockMethodChannel ();
@@ -26,14 +26,6 @@ void main() {
26
26
});
27
27
});
28
28
29
- test ('sharing null fails' , () {
30
- expect (
31
- () => Share .share (null ),
32
- throwsA (const TypeMatcher <AssertionError >()),
33
- );
34
- verifyZeroInteractions (mockChannel);
35
- });
36
-
37
29
test ('sharing empty fails' , () {
38
30
expect (
39
31
() => Share .share ('' ),
@@ -58,14 +50,6 @@ void main() {
58
50
}));
59
51
});
60
52
61
- test ('sharing null file fails' , () {
62
- expect (
63
- () => Share .shareFiles ([null ]),
64
- throwsA (const TypeMatcher <AssertionError >()),
65
- );
66
- verifyZeroInteractions (mockChannel);
67
- });
68
-
69
53
test ('sharing empty file fails' , () {
70
54
expect (
71
55
() => Share .shareFiles (['' ]),
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ readonly NNBD_PLUGINS_LIST=(
13
13
" local_auth"
14
14
" path_provider"
15
15
" plugin_platform_interface"
16
+ " share"
16
17
" url_launcher"
17
18
" video_player"
18
19
" webview_flutter"
You can’t perform that action at this time.
0 commit comments