Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 7f5d41e

Browse files
[share] Specify explicit type for invokeMethod & const for Rect (flutter#1881)
1 parent 646660c commit 7f5d41e

4 files changed

Lines changed: 13 additions & 17 deletions

File tree

packages/share/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.6.2+1
2+
3+
* Specify explicit type for `invokeMethod`.
4+
* Use `const` for `Rect`.
5+
* Updated minimum Flutter SDK to 1.6.0.
6+
17
## 0.6.2
28

39
* Add optional subject to fill email subject in case user selects email app.

packages/share/lib/share.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ class Share {
4949
params['originHeight'] = sharePositionOrigin.height;
5050
}
5151

52-
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
53-
// https://github.com/flutter/flutter/issues/26431
54-
// ignore: strong_mode_implicit_dynamic_method
55-
return channel.invokeMethod('share', params);
52+
return channel.invokeMethod<void>('share', params);
5653
}
5754
}

packages/share/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for sharing content via the platform share UI, using
33
the ACTION_SEND intent on Android and UIActivityViewController on iOS.
44
author: Flutter Team <flutter-dev@googlegroups.com>
55
homepage: https://github.com/flutter/plugins/tree/master/packages/share
6-
version: 0.6.2
6+
version: 0.6.2+1
77

88
flutter:
99
plugin:
@@ -24,4 +24,4 @@ dev_dependencies:
2424

2525
environment:
2626
sdk: ">=2.0.0-dev.28.0 <3.0.0"
27-
flutter: ">=0.1.4 <2.0.0"
27+
flutter: ">=1.6.0 <2.0.0"

packages/share/test/share_test.dart

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ void main() {
1717
mockChannel = MockMethodChannel();
1818
// Re-pipe to mockito for easier verifies.
1919
Share.channel.setMockMethodCallHandler((MethodCall call) async {
20-
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
21-
// https://github.com/flutter/flutter/issues/26431
22-
// ignore: strong_mode_implicit_dynamic_method
23-
mockChannel.invokeMethod(call.method, call.arguments);
20+
// The explicit type can be void as the only method call has a return type of void.
21+
mockChannel.invokeMethod<void>(call.method, call.arguments);
2422
});
2523
});
2624

@@ -44,14 +42,9 @@ void main() {
4442
await Share.share(
4543
'some text to share',
4644
subject: 'some subject to share',
47-
// TODO(jackson): Use const Rect when available in minimum Flutter SDK
48-
// ignore: prefer_const_constructors
49-
sharePositionOrigin: Rect.fromLTWH(1.0, 2.0, 3.0, 4.0),
45+
sharePositionOrigin: const Rect.fromLTWH(1.0, 2.0, 3.0, 4.0),
5046
);
51-
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
52-
// https://github.com/flutter/flutter/issues/26431
53-
// ignore: strong_mode_implicit_dynamic_method
54-
verify(mockChannel.invokeMethod('share', <String, dynamic>{
47+
verify(mockChannel.invokeMethod<void>('share', <String, dynamic>{
5548
'text': 'some text to share',
5649
'subject': 'some subject to share',
5750
'originX': 1.0,

0 commit comments

Comments
 (0)