Skip to content

Commit bad0154

Browse files
committed
fix analysis in integration test
1 parent f5ab0eb commit bad0154

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

packages/share_plus/share_plus/example/integration_test/share_plus_test.dart

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright 2019, the Chromium project authors. Please see the AUTHORS file
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
4+
45
import 'dart:io';
56

67
import 'package:flutter/services.dart';
@@ -12,13 +13,20 @@ void main() {
1213
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
1314

1415
testWidgets('Can launch share', (WidgetTester tester) async {
16+
final params = ShareParams(
17+
text: 'message',
18+
subject: 'title',
19+
);
1520
// Check isNotNull because we cannot wait for ShareResult
16-
expect(Share.share('message', subject: 'title'), isNotNull);
21+
expect(SharePlus.instance.share(params), isNotNull);
1722
});
1823

1924
testWidgets('Can launch shareUri', (WidgetTester tester) async {
25+
final params = ShareParams(
26+
uri: Uri.parse('https://example.com'),
27+
);
2028
// Check isNotNull because we cannot wait for ShareResult
21-
expect(Share.shareUri(Uri.parse('https://example.com')), isNotNull);
29+
expect(SharePlus.instance.share(params), isNotNull);
2230
}, skip: !Platform.isAndroid && !Platform.isIOS);
2331

2432
testWidgets('Can shareXFile created using File.fromData()',
@@ -27,6 +35,10 @@ void main() {
2735
final XFile file =
2836
XFile.fromData(bytes, name: 'image.jpg', mimeType: 'image/jpeg');
2937

30-
expect(Share.shareXFiles([file], text: "example"), isNotNull);
38+
final params = ShareParams(
39+
files: [file],
40+
text: 'message',
41+
);
42+
expect(SharePlus.instance.share(params), isNotNull);
3143
});
3244
}

0 commit comments

Comments
 (0)