From 22b07656133bd70b91c1c37935707ea3283328a7 Mon Sep 17 00:00:00 2001 From: Volodymyr Date: Tue, 21 Apr 2026 13:23:32 +0300 Subject: [PATCH 1/3] feat(share_plus): Lower requirements to Dart 3.10 and Flutter 3.38.1 --- packages/share_plus/share_plus/README.md | 4 ++-- packages/share_plus/share_plus/example/pubspec.yaml | 4 ++-- packages/share_plus/share_plus/pubspec.yaml | 6 +++--- .../share_plus/share_plus_platform_interface/pubspec.yaml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/share_plus/share_plus/README.md b/packages/share_plus/share_plus/README.md index 4af5f261aa..17807e794e 100644 --- a/packages/share_plus/share_plus/README.md +++ b/packages/share_plus/share_plus/README.md @@ -26,8 +26,8 @@ Sharing files is not supported on Linux. ## Requirements -- Flutter >=3.41.0 -- Dart >=3.11.0 <4.0.0 +- Flutter >=3.38.1 +- Dart >=3.10.0 <4.0.0 - iOS >=13.0 - macOS >=10.15 - Java 17 diff --git a/packages/share_plus/share_plus/example/pubspec.yaml b/packages/share_plus/share_plus/example/pubspec.yaml index 2c29fcf174..dfedb41fdd 100644 --- a/packages/share_plus/share_plus/example/pubspec.yaml +++ b/packages/share_plus/share_plus/example/pubspec.yaml @@ -24,5 +24,5 @@ flutter: - assets/flutter_logo.png environment: - sdk: '>=3.4.0 <4.0.0' - flutter: '>=3.22.0' + sdk: '>=3.10.0 <4.0.0' + flutter: '>=3.38.1' diff --git a/packages/share_plus/share_plus/pubspec.yaml b/packages/share_plus/share_plus/pubspec.yaml index 0926493002..839af38ead 100644 --- a/packages/share_plus/share_plus/pubspec.yaml +++ b/packages/share_plus/share_plus/pubspec.yaml @@ -43,7 +43,7 @@ dependencies: url_launcher_platform_interface: ^2.3.2 ffi: ^2.2.0 web: ^1.1.1 - win32: ^6.0.0 + win32: ^6.0.1 dev_dependencies: flutter_test: @@ -51,6 +51,6 @@ dev_dependencies: flutter_lints: ^6.0.0 environment: - sdk: ">=3.11.0 <4.0.0" - flutter: ">=3.41.0" + sdk: ">=3.10.0 <4.0.0" + flutter: ">=3.38.1" diff --git a/packages/share_plus/share_plus_platform_interface/pubspec.yaml b/packages/share_plus/share_plus_platform_interface/pubspec.yaml index 95852d1694..53bc0455dc 100644 --- a/packages/share_plus/share_plus_platform_interface/pubspec.yaml +++ b/packages/share_plus/share_plus_platform_interface/pubspec.yaml @@ -21,5 +21,5 @@ dev_dependencies: flutter_lints: ^6.0.0 environment: - sdk: ">=3.11.0 <4.0.0" - flutter: ">=3.41.0" + sdk: ">=3.10.0 <4.0.0" + flutter: ">=3.38.1" From 55aa7c0a9820fae54c2241d703a7b878308315b8 Mon Sep 17 00:00:00 2001 From: Volodymyr Date: Tue, 21 Apr 2026 13:32:26 +0300 Subject: [PATCH 2/3] fix(share_plus): Update example formatting --- .../integration_test/share_plus_test.dart | 26 ++++++++----------- .../example/lib/excluded_activity_type.dart | 5 ++-- .../example/lib/image_previews.dart | 22 ++++++++-------- .../share_plus/example/lib/main.dart | 18 +++++-------- 4 files changed, 31 insertions(+), 40 deletions(-) diff --git a/packages/share_plus/share_plus/example/integration_test/share_plus_test.dart b/packages/share_plus/share_plus/example/integration_test/share_plus_test.dart index 129637cd6e..4c63a0f421 100644 --- a/packages/share_plus/share_plus/example/integration_test/share_plus_test.dart +++ b/packages/share_plus/share_plus/example/integration_test/share_plus_test.dart @@ -13,32 +13,28 @@ void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('Can launch share', (WidgetTester tester) async { - final params = ShareParams( - text: 'message', - subject: 'title', - ); + final params = ShareParams(text: 'message', subject: 'title'); // Check isNotNull because we cannot wait for ShareResult expect(SharePlus.instance.share(params), isNotNull); }); testWidgets('Can launch shareUri', (WidgetTester tester) async { - final params = ShareParams( - uri: Uri.parse('https://example.com'), - ); + final params = ShareParams(uri: Uri.parse('https://example.com')); // Check isNotNull because we cannot wait for ShareResult expect(SharePlus.instance.share(params), isNotNull); }, skip: !Platform.isAndroid && !Platform.isIOS); - testWidgets('Can shareXFile created using File.fromData()', - (WidgetTester tester) async { + testWidgets('Can shareXFile created using File.fromData()', ( + WidgetTester tester, + ) async { final bytes = Uint8List.fromList([1, 2, 3, 4, 5, 6, 7, 8]); - final XFile file = - XFile.fromData(bytes, name: 'image.jpg', mimeType: 'image/jpeg'); - - final params = ShareParams( - files: [file], - text: 'message', + final XFile file = XFile.fromData( + bytes, + name: 'image.jpg', + mimeType: 'image/jpeg', ); + + final params = ShareParams(files: [file], text: 'message'); expect(SharePlus.instance.share(params), isNotNull); }); } diff --git a/packages/share_plus/share_plus/example/lib/excluded_activity_type.dart b/packages/share_plus/share_plus/example/lib/excluded_activity_type.dart index f1bb63b7e1..c66b62141e 100644 --- a/packages/share_plus/share_plus/example/lib/excluded_activity_type.dart +++ b/packages/share_plus/share_plus/example/lib/excluded_activity_type.dart @@ -44,8 +44,9 @@ class _ExcludedActivityTypePageState final List tempSelected = []; for (final String type in selected) { tempSelected.add( - CupertinoActivityType.values - .firstWhere((e) => e.value == type), + CupertinoActivityType.values.firstWhere( + (e) => e.value == type, + ), ); } Navigator.pop(context, tempSelected); diff --git a/packages/share_plus/share_plus/example/lib/image_previews.dart b/packages/share_plus/share_plus/example/lib/image_previews.dart index a41d6b6ad5..a4db482280 100644 --- a/packages/share_plus/share_plus/example/lib/image_previews.dart +++ b/packages/share_plus/share_plus/example/lib/image_previews.dart @@ -23,10 +23,12 @@ class ImagePreviews extends StatelessWidget { final imageWidgets = []; for (var i = 0; i < imagePaths.length; i++) { - imageWidgets.add(_ImagePreview( - imagePaths[i], - onDelete: onDelete != null ? () => onDelete!(i) : null, - )); + imageWidgets.add( + _ImagePreview( + imagePaths[i], + onDelete: onDelete != null ? () => onDelete!(i) : null, + ), + ); } return SingleChildScrollView( @@ -50,10 +52,7 @@ class _ImagePreview extends StatelessWidget { child: Stack( children: [ ConstrainedBox( - constraints: const BoxConstraints( - maxWidth: 200, - maxHeight: 200, - ), + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 200), child: kIsWeb ? Image.network(imagePath) : Image.file(imageFile), ), Positioned( @@ -61,9 +60,10 @@ class _ImagePreview extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: FloatingActionButton( - backgroundColor: Colors.red, - onPressed: onDelete, - child: const Icon(Icons.delete)), + backgroundColor: Colors.red, + onPressed: onDelete, + child: const Icon(Icons.delete), + ), ), ), ], diff --git a/packages/share_plus/share_plus/example/lib/main.dart b/packages/share_plus/share_plus/example/lib/main.dart index a7c5f1abc4..d172097da9 100644 --- a/packages/share_plus/share_plus/example/lib/main.dart +++ b/packages/share_plus/share_plus/example/lib/main.dart @@ -58,10 +58,7 @@ class MyHomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: const Text('Share Plus Plugin Demo'), - elevation: 4, - ), + appBar: AppBar(title: const Text('Share Plus Plugin Demo'), elevation: 4), body: SingleChildScrollView( padding: const EdgeInsets.all(24), child: Column( @@ -143,7 +140,8 @@ class MyHomePageState extends State { extensions: ['jpg', 'jpeg', 'png', 'gif'], ); final file = await openFile( - acceptedTypeGroups: [typeGroup]); + acceptedTypeGroups: [typeGroup], + ); if (file != null) { setState(() { imagePaths.add(file.path); @@ -316,9 +314,7 @@ class MyHomePageState extends State { ); scaffoldMessenger.showSnackBar(getResultSnackBar(shareResult)); } catch (e) { - scaffoldMessenger.showSnackBar( - SnackBar(content: Text('Error: $e')), - ); + scaffoldMessenger.showSnackBar(SnackBar(content: Text('Error: $e'))); } } @@ -345,9 +341,7 @@ class MyHomePageState extends State { scaffoldMessenger.showSnackBar(getResultSnackBar(shareResult)); } catch (e) { - scaffoldMessenger.showSnackBar( - SnackBar(content: Text('Error: $e')), - ); + scaffoldMessenger.showSnackBar(SnackBar(content: Text('Error: $e'))); } } @@ -359,7 +353,7 @@ class MyHomePageState extends State { children: [ Text("Share result: ${result.status}"), if (result.status == ShareResultStatus.success) - Text("Shared to: ${result.raw}") + Text("Shared to: ${result.raw}"), ], ), ); From e3385ffac7840645715008bed65d8a11ce0dd3f3 Mon Sep 17 00:00:00 2001 From: Volodymyr Date: Tue, 21 Apr 2026 13:53:43 +0300 Subject: [PATCH 3/3] fix(share_plus): Fix formatting --- .../share_plus/example/test_driver/share_plus_test.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/share_plus/share_plus/example/test_driver/share_plus_test.dart b/packages/share_plus/share_plus/example/test_driver/share_plus_test.dart index 8c663fb1db..a732616089 100644 --- a/packages/share_plus/share_plus/example/test_driver/share_plus_test.dart +++ b/packages/share_plus/share_plus/example/test_driver/share_plus_test.dart @@ -9,8 +9,10 @@ import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final driver = await FlutterDriver.connect(); - final data = - await driver.requestData(null, timeout: const Duration(minutes: 1)); + final data = await driver.requestData( + null, + timeout: const Duration(minutes: 1), + ); await driver.close(); final Map result = jsonDecode(data); exit(result['result'] == 'true' ? 0 : 1);