From 2b82ed0e340aae51fa3927cdf8e872657558c25c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 15 Jul 2023 12:50:47 +0200 Subject: [PATCH 01/23] [path_provider] Add getApplicationCachePath() Fixes: flutter/flutter#105386 --- .../path_provider/path_provider/CHANGELOG.md | 3 +- .../integration_test/path_provider_test.dart | 5 + .../path_provider/example/lib/main.dart | 30 +++++ .../example/pubspec_overrides.yaml | 9 ++ .../path_provider/lib/path_provider.dart | 21 +++- .../path_provider/path_provider/pubspec.yaml | 2 +- .../path_provider/pubspec_overrides.yaml | 3 + .../path_provider_android/CHANGELOG.md | 3 +- .../plugins/pathprovider/Messages.java | 109 ++++++++++-------- .../pathprovider/PathProviderPlugin.java | 9 ++ .../integration_test/path_provider_test.dart | 6 + .../example/lib/main.dart | 16 +++ .../example/pubspec_overrides.yaml | 5 + .../path_provider_android/lib/messages.g.dart | 43 +++++-- .../lib/path_provider_android.dart | 7 ++ .../pigeons/messages.dart | 3 + .../path_provider_android/pubspec.yaml | 2 +- .../pubspec_overrides.yaml | 3 + .../test/messages_test.g.dart | 77 ++++++------- .../test/path_provider_android_test.dart | 9 ++ .../path_provider_foundation/CHANGELOG.md | 4 + .../darwin/Classes/PathProviderPlugin.swift | 6 +- .../darwin/Classes/messages.g.swift | 1 + .../integration_test/path_provider_test.dart | 6 + .../example/lib/main.dart | 10 ++ .../example/pubspec_overrides.yaml | 5 + .../lib/messages.g.dart | 1 + .../lib/path_provider_foundation.dart | 12 ++ .../pigeons/messages.dart | 1 + .../path_provider_foundation/pubspec.yaml | 2 +- .../pubspec_overrides.yaml | 3 + .../test/path_provider_foundation_test.dart | 26 +++++ .../path_provider_linux/CHANGELOG.md | 4 + .../integration_test/path_provider_test.dart | 6 + .../path_provider_linux/example/lib/main.dart | 10 ++ .../lib/src/path_provider_linux.dart | 12 ++ .../path_provider_linux/pubspec.yaml | 2 +- .../pubspec_overrides.yaml | 3 + .../test/path_provider_linux_test.dart | 7 ++ .../CHANGELOG.md | 3 +- .../lib/path_provider_platform_interface.dart | 6 + .../lib/src/enums.dart | 3 + .../lib/src/method_channel_path_provider.dart | 5 + .../pubspec.yaml | 2 +- .../method_channel_path_provider_test.dart | 15 +++ .../path_provider_windows/CHANGELOG.md | 4 + .../integration_test/path_provider_test.dart | 6 + .../example/lib/main.dart | 10 ++ .../example/pubspec_overrides.yaml | 5 + .../lib/src/path_provider_windows_real.dart | 20 ++++ .../path_provider_windows/pubspec.yaml | 2 +- .../pubspec_overrides.yaml | 3 + .../test/path_provider_windows_test.dart | 14 +++ 53 files changed, 476 insertions(+), 108 deletions(-) create mode 100644 packages/path_provider/path_provider/example/pubspec_overrides.yaml create mode 100644 packages/path_provider/path_provider/pubspec_overrides.yaml create mode 100644 packages/path_provider/path_provider_android/example/pubspec_overrides.yaml create mode 100644 packages/path_provider/path_provider_android/pubspec_overrides.yaml create mode 100644 packages/path_provider/path_provider_foundation/example/pubspec_overrides.yaml create mode 100644 packages/path_provider/path_provider_foundation/pubspec_overrides.yaml create mode 100644 packages/path_provider/path_provider_linux/pubspec_overrides.yaml create mode 100644 packages/path_provider/path_provider_windows/example/pubspec_overrides.yaml create mode 100644 packages/path_provider/path_provider_windows/pubspec_overrides.yaml diff --git a/packages/path_provider/path_provider/CHANGELOG.md b/packages/path_provider/path_provider/CHANGELOG.md index 9f76a52afdd0..3d943fb035c0 100644 --- a/packages/path_provider/path_provider/CHANGELOG.md +++ b/packages/path_provider/path_provider/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 2.1.0 +* Adds getApplicationCachePath() for storing app-specific cache files. * Updates minimum supported macOS version to 10.14. * Updates minimum supported SDK version to Flutter 3.3/Dart 2.18. diff --git a/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart b/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart index f59a8faf31e0..1a70c573e54b 100644 --- a/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart +++ b/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart @@ -25,6 +25,11 @@ void main() { _verifySampleFile(result, 'applicationSupport'); }); + testWidgets('getApplicationCacheDirectory', (WidgetTester tester) async { + final Directory result = await getApplicationCacheDirectory(); + _verifySampleFile(result, 'applicationCache'); + }); + testWidgets('getLibraryDirectory', (WidgetTester tester) async { if (Platform.isIOS) { final Directory result = await getLibraryDirectory(); diff --git a/packages/path_provider/path_provider/example/lib/main.dart b/packages/path_provider/path_provider/example/lib/main.dart index 2863d2d43ac9..6b769429846e 100644 --- a/packages/path_provider/path_provider/example/lib/main.dart +++ b/packages/path_provider/path_provider/example/lib/main.dart @@ -41,6 +41,7 @@ class _MyHomePageState extends State { Future? _appSupportDirectory; Future? _appLibraryDirectory; Future? _appDocumentsDirectory; + Future? _appCacheDirectory; Future? _externalDocumentsDirectory; Future?>? _externalStorageDirectories; Future?>? _externalCacheDirectories; @@ -102,6 +103,12 @@ class _MyHomePageState extends State { }); } + void _requestAppCacheDirectory() { + setState(() { + _appCacheDirectory = getApplicationCacheDirectory(); + }); + } + void _requestExternalStorageDirectory() { setState(() { _externalDocumentsDirectory = getExternalStorageDirectory(); @@ -206,6 +213,29 @@ class _MyHomePageState extends State { ), ], ), + Column( + children: [ + Padding( + padding: const EdgeInsets.all(16.0), + child: ElevatedButton( + onPressed: Platform.isLinux || + Platform.isMacOS || + Platform.isWindows + ? _requestAppCacheDirectory + : null, + child: Text( + Platform.isAndroid + ? 'Application Cache Directory unavailable' + : 'Get Application Cache Directory', + ), + ), + ), + FutureBuilder( + future: _appCacheDirectory, + builder: _buildDirectory, + ), + ], + ), Column( children: [ Padding( diff --git a/packages/path_provider/path_provider/example/pubspec_overrides.yaml b/packages/path_provider/path_provider/example/pubspec_overrides.yaml new file mode 100644 index 000000000000..48933b156a7f --- /dev/null +++ b/packages/path_provider/path_provider/example/pubspec_overrides.yaml @@ -0,0 +1,9 @@ +dependency_overrides: + path_provider_platform_interface: + path: ../../path_provider_platform_interface + path_provider_linux: + path: ../../path_provider_linux + path_provider_foundation: + path: ../../path_provider_foundation + path_provider_windows: + path: ../../path_provider_windows diff --git a/packages/path_provider/path_provider/lib/path_provider.dart b/packages/path_provider/path_provider/lib/path_provider.dart index b58a7ff6cc7b..e7ab24fbe49f 100644 --- a/packages/path_provider/path_provider/lib/path_provider.dart +++ b/packages/path_provider/path_provider/lib/path_provider.dart @@ -107,8 +107,9 @@ Future getLibraryDirectory() async { /// Path to a directory where the application may place data that is /// user-generated, or that cannot otherwise be recreated by your application. /// -/// Consider using another path, such as [getApplicationSupportDirectory] or -/// [getExternalStorageDirectory], if the data is not user-generated. +/// Consider using another path, such as [getApplicationSupportDirectory], +/// [getApplicationCacheDirectory], or [getExternalStorageDirectory], if the +/// data is not user-generated. /// /// Example implementations: /// - `NSDocumentDirectory` on iOS and macOS. @@ -125,6 +126,22 @@ Future getApplicationDocumentsDirectory() async { return Directory(path); } +/// Path to a directory where the application may place application-specific +/// cache files. +/// +/// If this directory does not exist, it is created automatically. +/// +/// Throws a [MissingPlatformDirectoryException] if the system is unable to +/// provide the directory. +Future getApplicationCacheDirectory() async { + final String? path = await _platform.getApplicationCachePath(); + if (path == null) { + throw MissingPlatformDirectoryException( + 'Unable to get application cache directory'); + } + return Directory(path); +} + /// Path to a directory where the application may access top level storage. /// /// Example implementation: diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 4e7326a1be8c..4f80357a590e 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider description: Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories. repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22 -version: 2.0.15 +version: 2.1.0 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/packages/path_provider/path_provider/pubspec_overrides.yaml b/packages/path_provider/path_provider/pubspec_overrides.yaml new file mode 100644 index 000000000000..462aee402acb --- /dev/null +++ b/packages/path_provider/path_provider/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + path_provider_platform_interface: + path: ../path_provider_platform_interface diff --git a/packages/path_provider/path_provider_android/CHANGELOG.md b/packages/path_provider/path_provider_android/CHANGELOG.md index 816457564de8..f829dcc73b6f 100644 --- a/packages/path_provider/path_provider_android/CHANGELOG.md +++ b/packages/path_provider/path_provider_android/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 2.1.0 +* Adds getApplicationCachePath() for storing app-specific cache files. * Updates minimum supported SDK version to Flutter 3.3/Dart 2.18. ## 2.0.27 diff --git a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java index 11cda6b42806..422d8d40bfbc 100644 --- a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java +++ b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v9.2.4), do not edit directly. +// Autogenerated from Pigeon (v9.2.5), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.pathprovider; @@ -13,8 +13,14 @@ import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MessageCodec; import io.flutter.plugin.common.StandardMessageCodec; +import java.io.ByteArrayOutputStream; +import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -29,7 +35,8 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) + { super(message); this.code = code; this.details = details; @@ -48,7 +55,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @@ -64,7 +71,8 @@ public enum StorageDirectory { MOVIES(7), DOWNLOADS(8), DCIM(9), - DOCUMENTS(10); + DOCUMENTS(10), + CACHE(11); final int index; @@ -75,40 +83,38 @@ private StorageDirectory(final int index) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PathProviderApi { - @Nullable + @Nullable String getTemporaryPath(); - @Nullable + @Nullable String getApplicationSupportPath(); - @Nullable + @Nullable String getApplicationDocumentsPath(); - @Nullable + @Nullable + String getApplicationCachePath(); + + @Nullable String getExternalStoragePath(); - @NonNull + @NonNull List getExternalCachePaths(); - @NonNull + @NonNull List getExternalStoragePaths(@NonNull StorageDirectory directory); /** The codec used by PathProviderApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `PathProviderApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `PathProviderApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProviderApi api) { { BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getTemporaryPath", - getCodec(), - taskQueue); + binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getTemporaryPath", getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -116,7 +122,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid try { String output = api.getTemporaryPath(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -130,10 +137,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath", - getCodec(), - taskQueue); + binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath", getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -141,7 +145,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid try { String output = api.getApplicationSupportPath(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -155,10 +160,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath", - getCodec(), - taskQueue); + binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath", getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -166,7 +168,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid try { String output = api.getApplicationDocumentsPath(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -180,10 +183,30 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getExternalStoragePath", - getCodec(), - taskQueue); + binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getApplicationCachePath", getCodec(), taskQueue); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList(); + try { + String output = api.getApplicationCachePath(); + wrapped.add(0, output); + } + catch (Throwable exception) { + ArrayList wrappedError = wrapError(exception); + wrapped = wrappedError; + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getExternalStoragePath", getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -191,7 +214,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid try { String output = api.getExternalStoragePath(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -205,10 +229,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getExternalCachePaths", - getCodec(), - taskQueue); + binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getExternalCachePaths", getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -216,7 +237,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid try { List output = api.getExternalCachePaths(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -230,21 +252,18 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths", - getCodec(), - taskQueue); + binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths", getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; - StorageDirectory directoryArg = - args.get(0) == null ? null : StorageDirectory.values()[(int) args.get(0)]; + StorageDirectory directoryArg = args.get(0) == null ? null : StorageDirectory.values()[(int) args.get(0)]; try { List output = api.getExternalStoragePaths(directoryArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } diff --git a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java index 6e259cf5128f..1ddd6e048473 100644 --- a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java +++ b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java @@ -66,6 +66,11 @@ public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { return getPathProviderApplicationDocumentsDirectory(); } + @Override + public @Nullable String getApplicationCachePath() { + return getPathProviderApplicationCacheDirectory(); + } + @Override public @Nullable String getExternalStoragePath() { return getPathProviderStorageDirectory(); @@ -86,6 +91,10 @@ private String getPathProviderTemporaryDirectory() { return context.getCacheDir().getPath(); } + private String getPathProviderApplicationCacheDirectory() { + return context.getCacheDir().getPath(); + } + private String getApplicationSupportDirectory() { return PathUtils.getFilesDir(context); } diff --git a/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart b/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart index ecd0b973343b..1403d932d292 100644 --- a/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart +++ b/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart @@ -28,6 +28,12 @@ void main() { _verifySampleFile(result, 'applicationSupport'); }); + testWidgets('getApplicationCacheDirectory', (WidgetTester tester) async { + final PathProviderPlatform provider = PathProviderPlatform.instance; + final String? result = await provider.getApplicationCachePath(); + _verifySampleFile(result, 'applicationCache'); + }); + testWidgets('getLibraryDirectory', (WidgetTester tester) async { final PathProviderPlatform provider = PathProviderPlatform.instance; expect(() => provider.getLibraryPath(), diff --git a/packages/path_provider/path_provider_android/example/lib/main.dart b/packages/path_provider/path_provider_android/example/lib/main.dart index d0bc13bc0643..79293e155c01 100644 --- a/packages/path_provider/path_provider_android/example/lib/main.dart +++ b/packages/path_provider/path_provider_android/example/lib/main.dart @@ -39,6 +39,7 @@ class _MyHomePageState extends State { Future? _tempDirectory; Future? _appSupportDirectory; Future? _appDocumentsDirectory; + Future? _appCacheDirectory; Future? _externalDocumentsDirectory; Future?>? _externalStorageDirectories; Future?>? _externalCacheDirectories; @@ -92,6 +93,12 @@ class _MyHomePageState extends State { }); } + void _requestAppCacheDirectory() { + setState(() { + _appCacheDirectory = provider.getApplicationCachePath(); + }); + } + void _requestExternalStorageDirectory() { setState(() { _externalDocumentsDirectory = provider.getExternalStoragePath(); @@ -147,6 +154,15 @@ class _MyHomePageState extends State { ), FutureBuilder( future: _appSupportDirectory, builder: _buildDirectory), + Padding( + padding: const EdgeInsets.all(16.0), + child: ElevatedButton( + onPressed: _requestAppCacheDirectory, + child: const Text('Get Application Cache Directory'), + ), + ), + FutureBuilder( + future: _appCacheDirectory, builder: _buildDirectory), Padding( padding: const EdgeInsets.all(16.0), child: ElevatedButton( diff --git a/packages/path_provider/path_provider_android/example/pubspec_overrides.yaml b/packages/path_provider/path_provider_android/example/pubspec_overrides.yaml new file mode 100644 index 000000000000..4adf33b8852d --- /dev/null +++ b/packages/path_provider/path_provider_android/example/pubspec_overrides.yaml @@ -0,0 +1,5 @@ +dependency_overrides: + path_provider_platform_interface: + path: ../../path_provider_platform_interface + path_provider_android: + path: ../../path_provider_android diff --git a/packages/path_provider/path_provider_android/lib/messages.g.dart b/packages/path_provider/path_provider_android/lib/messages.g.dart index ec5c1f9506fa..2f84665d06ec 100644 --- a/packages/path_provider/path_provider_android/lib/messages.g.dart +++ b/packages/path_provider/path_provider_android/lib/messages.g.dart @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v9.2.4), do not edit directly. +// Autogenerated from Pigeon (v9.2.5), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import @@ -23,6 +23,7 @@ enum StorageDirectory { downloads, dcim, documents, + cache, } class PathProviderApi { @@ -39,7 +40,8 @@ class PathProviderApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getTemporaryPath', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -60,7 +62,8 @@ class PathProviderApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -81,7 +84,30 @@ class PathProviderApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else { + return (replyList[0] as String?); + } + } + + Future getApplicationCachePath() async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.PathProviderApi.getApplicationCachePath', codec, + binaryMessenger: _binaryMessenger); + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -102,7 +128,8 @@ class PathProviderApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePath', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -123,7 +150,8 @@ class PathProviderApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getExternalCachePaths', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -145,8 +173,7 @@ class PathProviderApi { } } - Future> getExternalStoragePaths( - StorageDirectory arg_directory) async { + Future> getExternalStoragePaths(StorageDirectory arg_directory) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths', codec, binaryMessenger: _binaryMessenger); diff --git a/packages/path_provider/path_provider_android/lib/path_provider_android.dart b/packages/path_provider/path_provider_android/lib/path_provider_android.dart index f5c74f540253..c647f12b95d1 100644 --- a/packages/path_provider/path_provider_android/lib/path_provider_android.dart +++ b/packages/path_provider/path_provider_android/lib/path_provider_android.dart @@ -30,6 +30,8 @@ messages.StorageDirectory _convertStorageDirectory( return messages.StorageDirectory.dcim; case StorageDirectory.documents: return messages.StorageDirectory.documents; + case StorageDirectory.cache: + return messages.StorageDirectory.cache; } } @@ -62,6 +64,11 @@ class PathProviderAndroid extends PathProviderPlatform { return _api.getApplicationDocumentsPath(); } + @override + Future getApplicationCachePath() { + return _api.getApplicationCachePath(); + } + @override Future getExternalStoragePath() { return _api.getExternalStoragePath(); diff --git a/packages/path_provider/path_provider_android/pigeons/messages.dart b/packages/path_provider/path_provider_android/pigeons/messages.dart index 96ad6343d3b0..ff0581ad2858 100644 --- a/packages/path_provider/path_provider_android/pigeons/messages.dart +++ b/packages/path_provider/path_provider_android/pigeons/messages.dart @@ -25,6 +25,7 @@ enum StorageDirectory { downloads, dcim, documents, + cache, } @HostApi(dartHostTestHandler: 'TestPathProviderApi') @@ -36,6 +37,8 @@ abstract class PathProviderApi { @TaskQueue(type: TaskQueueType.serialBackgroundThread) String? getApplicationDocumentsPath(); @TaskQueue(type: TaskQueueType.serialBackgroundThread) + String? getApplicationCachePath(); + @TaskQueue(type: TaskQueueType.serialBackgroundThread) String? getExternalStoragePath(); @TaskQueue(type: TaskQueueType.serialBackgroundThread) List getExternalCachePaths(); diff --git a/packages/path_provider/path_provider_android/pubspec.yaml b/packages/path_provider/path_provider_android/pubspec.yaml index ee8317394652..626cbd810552 100644 --- a/packages/path_provider/path_provider_android/pubspec.yaml +++ b/packages/path_provider/path_provider_android/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider_android description: Android implementation of the path_provider plugin. repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22 -version: 2.0.27 +version: 2.1.0 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/packages/path_provider/path_provider_android/pubspec_overrides.yaml b/packages/path_provider/path_provider_android/pubspec_overrides.yaml new file mode 100644 index 000000000000..462aee402acb --- /dev/null +++ b/packages/path_provider/path_provider_android/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + path_provider_platform_interface: + path: ../path_provider_platform_interface diff --git a/packages/path_provider/path_provider_android/test/messages_test.g.dart b/packages/path_provider/path_provider_android/test/messages_test.g.dart index 515f6b549fe1..cc477ba8751b 100644 --- a/packages/path_provider/path_provider_android/test/messages_test.g.dart +++ b/packages/path_provider/path_provider_android/test/messages_test.g.dart @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v9.2.4), do not edit directly. +// Autogenerated from Pigeon (v9.2.5), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import // ignore_for_file: avoid_relative_lib_imports @@ -14,8 +14,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:path_provider_android/messages.g.dart'; abstract class TestPathProviderApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); String? getTemporaryPath(); @@ -24,25 +23,23 @@ abstract class TestPathProviderApi { String? getApplicationDocumentsPath(); + String? getApplicationCachePath(); + String? getExternalStoragePath(); List getExternalCachePaths(); List getExternalStoragePaths(StorageDirectory directory); - static void setup(TestPathProviderApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestPathProviderApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getTemporaryPath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message final String? output = api.getTemporaryPath(); return [output]; @@ -54,12 +51,9 @@ abstract class TestPathProviderApi { 'dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message final String? output = api.getApplicationSupportPath(); return [output]; @@ -68,33 +62,40 @@ abstract class TestPathProviderApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath', - codec, + 'dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message final String? output = api.getApplicationDocumentsPath(); return [output]; }); } } + { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.PathProviderApi.getApplicationCachePath', codec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + // ignore message + final String? output = api.getApplicationCachePath(); + return [output]; + }); + } + } { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message final String? output = api.getExternalStoragePath(); return [output]; @@ -106,12 +107,9 @@ abstract class TestPathProviderApi { 'dev.flutter.pigeon.PathProviderApi.getExternalCachePaths', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message final List output = api.getExternalCachePaths(); return [output]; @@ -123,21 +121,16 @@ abstract class TestPathProviderApi { 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths was null.'); + 'Argument for dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths was null.'); final List args = (message as List?)!; - final StorageDirectory? arg_directory = - args[0] == null ? null : StorageDirectory.values[args[0] as int]; + final StorageDirectory? arg_directory = args[0] == null ? null : StorageDirectory.values[args[0] as int]; assert(arg_directory != null, 'Argument for dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths was null, expected non-null StorageDirectory.'); - final List output = - api.getExternalStoragePaths(arg_directory!); + final List output = api.getExternalStoragePaths(arg_directory!); return [output]; }); } diff --git a/packages/path_provider/path_provider_android/test/path_provider_android_test.dart b/packages/path_provider/path_provider_android/test/path_provider_android_test.dart index e3011474a2a3..5f94da6c4f3c 100644 --- a/packages/path_provider/path_provider_android/test/path_provider_android_test.dart +++ b/packages/path_provider/path_provider_android/test/path_provider_android_test.dart @@ -12,6 +12,7 @@ const String kTemporaryPath = 'temporaryPath'; const String kApplicationSupportPath = 'applicationSupportPath'; const String kLibraryPath = 'libraryPath'; const String kApplicationDocumentsPath = 'applicationDocumentsPath'; +const String kApplicationCachePath = 'applicationCachePath'; const String kExternalCachePaths = 'externalCachePaths'; const String kExternalStoragePaths = 'externalStoragePaths'; const String kDownloadsPath = 'downloadsPath'; @@ -23,6 +24,9 @@ class _Api implements TestPathProviderApi { @override String? getApplicationSupportPath() => kApplicationSupportPath; + @override + String? getApplicationCachePath() => kApplicationCachePath; + @override List getExternalCachePaths() => [kExternalCachePaths]; @@ -58,6 +62,11 @@ void main() { expect(path, kApplicationSupportPath); }); + test('getApplicationCachePath', () async { + final String? path = await pathProvider.getApplicationCachePath(); + expect(path, kApplicationCachePath); + }); + test('getLibraryPath fails', () async { try { await pathProvider.getLibraryPath(); diff --git a/packages/path_provider/path_provider_foundation/CHANGELOG.md b/packages/path_provider/path_provider_foundation/CHANGELOG.md index 1bbba4de2215..0142c0408cbc 100644 --- a/packages/path_provider/path_provider_foundation/CHANGELOG.md +++ b/packages/path_provider/path_provider_foundation/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.3.0 + +* Adds getApplicationCachePath() for storing app-specific cache files. + ## 2.2.4 * Updates to the latest version of `pigeon`. diff --git a/packages/path_provider/path_provider_foundation/darwin/Classes/PathProviderPlugin.swift b/packages/path_provider/path_provider_foundation/darwin/Classes/PathProviderPlugin.swift index e2346b0f14b5..5530b8be026d 100644 --- a/packages/path_provider/path_provider_foundation/darwin/Classes/PathProviderPlugin.swift +++ b/packages/path_provider/path_provider_foundation/darwin/Classes/PathProviderPlugin.swift @@ -25,12 +25,12 @@ public class PathProviderPlugin: NSObject, FlutterPlugin, PathProviderApi { func getDirectoryPath(type: DirectoryType) -> String? { var path = getDirectory(ofType: fileManagerDirectoryForType(type)) #if os(macOS) - // In a non-sandboxed app, this is a shared directory where applications are + // In a non-sandboxed app, these are shared directories where applications are // expected to use its bundle ID as a subdirectory. (For non-sandboxed apps, // adding the extra path is harmless). // This is not done for iOS, for compatibility with older versions of the // plugin. - if type == .applicationSupport { + if type == .applicationSupport || type == .applicationCache { if let basePath = path { let basePathURL = URL.init(fileURLWithPath: basePath) path = basePathURL.appendingPathComponent(Bundle.main.bundleIdentifier!).path @@ -49,6 +49,8 @@ public class PathProviderPlugin: NSObject, FlutterPlugin, PathProviderApi { /// Returns the FileManager constant corresponding to the given type. private func fileManagerDirectoryForType(_ type: DirectoryType) -> FileManager.SearchPathDirectory { switch type { + case .applicationCache: + return FileManager.SearchPathDirectory.cachesDirectory case .applicationDocuments: return FileManager.SearchPathDirectory.documentDirectory case .applicationSupport: diff --git a/packages/path_provider/path_provider_foundation/darwin/Classes/messages.g.swift b/packages/path_provider/path_provider_foundation/darwin/Classes/messages.g.swift index 402e14f2d32d..4af5ac366630 100644 --- a/packages/path_provider/path_provider_foundation/darwin/Classes/messages.g.swift +++ b/packages/path_provider/path_provider_foundation/darwin/Classes/messages.g.swift @@ -44,6 +44,7 @@ enum DirectoryType: Int { case downloads = 2 case library = 3 case temp = 4 + case applicationCache = 5 } /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol PathProviderApi { diff --git a/packages/path_provider/path_provider_foundation/example/integration_test/path_provider_test.dart b/packages/path_provider/path_provider_foundation/example/integration_test/path_provider_test.dart index b67730a781fd..0d05745127aa 100644 --- a/packages/path_provider/path_provider_foundation/example/integration_test/path_provider_test.dart +++ b/packages/path_provider/path_provider_foundation/example/integration_test/path_provider_test.dart @@ -29,6 +29,12 @@ void main() { _verifySampleFile(result, 'applicationSupport'); }); + testWidgets('getApplicationCacheDirectory', (WidgetTester tester) async { + final PathProviderPlatform provider = PathProviderPlatform.instance; + final String? result = await provider.getApplicationCachePath(); + _verifySampleFile(result, 'applicationCache'); + }); + testWidgets('getLibraryDirectory', (WidgetTester tester) async { final PathProviderPlatform provider = PathProviderPlatform.instance; final String? result = await provider.getLibraryPath(); diff --git a/packages/path_provider/path_provider_foundation/example/lib/main.dart b/packages/path_provider/path_provider_foundation/example/lib/main.dart index 3e3a599f9198..c766ccf96e90 100644 --- a/packages/path_provider/path_provider_foundation/example/lib/main.dart +++ b/packages/path_provider/path_provider_foundation/example/lib/main.dart @@ -27,6 +27,7 @@ class _MyAppState extends State { String? _appSupportDirectory = 'Unknown'; String? _documentsDirectory = 'Unknown'; String? _containerDirectory = 'Unknown'; + String? _cacheDirectory = 'Unknown'; @override void initState() { @@ -42,6 +43,7 @@ class _MyAppState extends State { String? libraryDirectory; String? documentsDirectory; String? containerDirectory; + String? cacheDirectory; final PathProviderPlatform provider = PathProviderPlatform.instance; final PathProviderFoundation providerFoundation = PathProviderFoundation(); @@ -82,6 +84,12 @@ class _MyAppState extends State { 'Failed to get app group container directory: $exception'; } + try { + cacheDirectory = await provider.getApplicationCachePath(); + } catch (exception) { + cacheDirectory = 'Failed to get cache directory: $exception'; + } + setState(() { _tempDirectory = tempDirectory; _downloadsDirectory = downloadsDirectory; @@ -89,6 +97,7 @@ class _MyAppState extends State { _appSupportDirectory = appSupportDirectory; _documentsDirectory = documentsDirectory; _containerDirectory = containerDirectory; + _cacheDirectory = cacheDirectory; }); } @@ -108,6 +117,7 @@ class _MyAppState extends State { Text('Library Directory: $_libraryDirectory\n'), Text('Application Support Directory: $_appSupportDirectory\n'), Text('App Group Container Directory: $_containerDirectory\n'), + Text('Cache Directory: $_cacheDirectory\n'), ], ), ), diff --git a/packages/path_provider/path_provider_foundation/example/pubspec_overrides.yaml b/packages/path_provider/path_provider_foundation/example/pubspec_overrides.yaml new file mode 100644 index 000000000000..e24f73c519d2 --- /dev/null +++ b/packages/path_provider/path_provider_foundation/example/pubspec_overrides.yaml @@ -0,0 +1,5 @@ +dependency_overrides: + path_provider_platform_interface: + path: ../../path_provider_platform_interface + path_provider_foundation: + path: ../../path_provider_foundation diff --git a/packages/path_provider/path_provider_foundation/lib/messages.g.dart b/packages/path_provider/path_provider_foundation/lib/messages.g.dart index 7893dbd25e6c..3fdbadd5ae25 100644 --- a/packages/path_provider/path_provider_foundation/lib/messages.g.dart +++ b/packages/path_provider/path_provider_foundation/lib/messages.g.dart @@ -17,6 +17,7 @@ enum DirectoryType { downloads, library, temp, + applicationCache, } class PathProviderApi { diff --git a/packages/path_provider/path_provider_foundation/lib/path_provider_foundation.dart b/packages/path_provider/path_provider_foundation/lib/path_provider_foundation.dart index 32bbf020ea9d..55e24c4f2592 100644 --- a/packages/path_provider/path_provider_foundation/lib/path_provider_foundation.dart +++ b/packages/path_provider/path_provider_foundation/lib/path_provider_foundation.dart @@ -51,6 +51,18 @@ class PathProviderFoundation extends PathProviderPlatform { return _pathProvider.getDirectoryPath(DirectoryType.applicationDocuments); } + @override + Future getApplicationCachePath() async { + final String? path = + await _pathProvider.getDirectoryPath(DirectoryType.applicationCache); + if (path != null) { + // Ensure the directory exists before returning it, for consistency with + // other platforms. + await Directory(path).create(recursive: true); + } + return path; + } + @override Future getExternalStoragePath() async { throw UnsupportedError( diff --git a/packages/path_provider/path_provider_foundation/pigeons/messages.dart b/packages/path_provider/path_provider_foundation/pigeons/messages.dart index e3d9d0dc3b7d..ae4e7c144b35 100644 --- a/packages/path_provider/path_provider_foundation/pigeons/messages.dart +++ b/packages/path_provider/path_provider_foundation/pigeons/messages.dart @@ -16,6 +16,7 @@ enum DirectoryType { downloads, library, temp, + applicationCache, } @HostApi(dartHostTestHandler: 'TestPathProviderApi') diff --git a/packages/path_provider/path_provider_foundation/pubspec.yaml b/packages/path_provider/path_provider_foundation/pubspec.yaml index 936e182f263a..a80322c10db9 100644 --- a/packages/path_provider/path_provider_foundation/pubspec.yaml +++ b/packages/path_provider/path_provider_foundation/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider_foundation description: iOS and macOS implementation of the path_provider plugin repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_foundation issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22 -version: 2.2.4 +version: 2.3.0 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/packages/path_provider/path_provider_foundation/pubspec_overrides.yaml b/packages/path_provider/path_provider_foundation/pubspec_overrides.yaml new file mode 100644 index 000000000000..462aee402acb --- /dev/null +++ b/packages/path_provider/path_provider_foundation/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + path_provider_platform_interface: + path: ../path_provider_platform_interface diff --git a/packages/path_provider/path_provider_foundation/test/path_provider_foundation_test.dart b/packages/path_provider/path_provider_foundation/test/path_provider_foundation_test.dart index e8337a7e0948..e13e182a4132 100644 --- a/packages/path_provider/path_provider_foundation/test/path_provider_foundation_test.dart +++ b/packages/path_provider/path_provider_foundation/test/path_provider_foundation_test.dart @@ -98,6 +98,32 @@ void main() { expect(path, applicationDocumentsPath); }); + test('getApplicationCachePath', () async { + final PathProviderFoundation pathProvider = PathProviderFoundation(); + final String applicationCachePath = + p.join(testRoot.path, 'application', 'cache', 'path'); + when(mockApi.getDirectoryPath(DirectoryType.applicationCache)) + .thenReturn(applicationCachePath); + + final String? path = await pathProvider.getApplicationCachePath(); + + verify(mockApi.getDirectoryPath(DirectoryType.applicationCache)); + expect(path, applicationCachePath); + }); + + test('getApplicationCachePath creates the directory if necessary', + () async { + final PathProviderFoundation pathProvider = PathProviderFoundation(); + final String applicationCachePath = + p.join(testRoot.path, 'application', 'cache', 'path'); + when(mockApi.getDirectoryPath(DirectoryType.applicationCache)) + .thenReturn(applicationCachePath); + + final String? path = await pathProvider.getApplicationCachePath(); + + expect(Directory(path!).existsSync(), isTrue); + }); + test('getDownloadsPath', () async { final PathProviderFoundation pathProvider = PathProviderFoundation(); final String downloadsPath = p.join(testRoot.path, 'downloads', 'path'); diff --git a/packages/path_provider/path_provider_linux/CHANGELOG.md b/packages/path_provider/path_provider_linux/CHANGELOG.md index 7b4f83da3fd9..09a9d94a4558 100644 --- a/packages/path_provider/path_provider_linux/CHANGELOG.md +++ b/packages/path_provider/path_provider_linux/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.2.0 + +* Adds getApplicationCachePath() for storing app-specific cache files. + ## 2.1.11 * Removes obsolete null checks on non-nullable values. diff --git a/packages/path_provider/path_provider_linux/example/integration_test/path_provider_test.dart b/packages/path_provider/path_provider_linux/example/integration_test/path_provider_test.dart index 3bd644f69763..3353f5617ce8 100644 --- a/packages/path_provider/path_provider_linux/example/integration_test/path_provider_test.dart +++ b/packages/path_provider/path_provider_linux/example/integration_test/path_provider_test.dart @@ -36,6 +36,12 @@ void main() { final String? result = await provider.getApplicationSupportPath(); _verifySampleFile(result, 'applicationSupport'); }); + + testWidgets('getApplicationCacheDirectory', (WidgetTester tester) async { + final PathProviderLinux provider = PathProviderLinux(); + final String? result = await provider.getApplicationCachePath(); + _verifySampleFile(result, 'applicationCache'); + }); } /// Verify a file called [name] in [directoryPath] by recreating it with test diff --git a/packages/path_provider/path_provider_linux/example/lib/main.dart b/packages/path_provider/path_provider_linux/example/lib/main.dart index 254360cae4ee..0c8d214f3fd2 100644 --- a/packages/path_provider/path_provider_linux/example/lib/main.dart +++ b/packages/path_provider/path_provider_linux/example/lib/main.dart @@ -23,6 +23,7 @@ class _MyAppState extends State { String? _tempDirectory = 'Unknown'; String? _downloadsDirectory = 'Unknown'; String? _appSupportDirectory = 'Unknown'; + String? _appCacheDirectory = 'Unknown'; String? _documentsDirectory = 'Unknown'; final PathProviderLinux _provider = PathProviderLinux(); @@ -37,6 +38,7 @@ class _MyAppState extends State { String? tempDirectory; String? downloadsDirectory; String? appSupportDirectory; + String? appCacheDirectory; String? documentsDirectory; // Platform messages may fail, so we use a try/catch PlatformException. try { @@ -61,6 +63,12 @@ class _MyAppState extends State { } on PlatformException { appSupportDirectory = 'Failed to get documents directory.'; } + + try { + appCacheDirectory = await _provider.getApplicationCachePath(); + } on PlatformException { + appCacheDirectory = 'Failed to get cacge directory.'; + } // If the widget was removed from the tree while the asynchronous platform // message was in flight, we want to discard the reply rather than calling // setState to update our non-existent appearance. @@ -72,6 +80,7 @@ class _MyAppState extends State { _tempDirectory = tempDirectory; _downloadsDirectory = downloadsDirectory; _appSupportDirectory = appSupportDirectory; + _appCacheDirectory = appCacheDirectory; _documentsDirectory = documentsDirectory; }); } @@ -90,6 +99,7 @@ class _MyAppState extends State { Text('Documents Directory: $_documentsDirectory\n'), Text('Downloads Directory: $_downloadsDirectory\n'), Text('Application Support Directory: $_appSupportDirectory\n'), + Text('Application Cache Directory: $_appCacheDirectory\n'), ], ), ), diff --git a/packages/path_provider/path_provider_linux/lib/src/path_provider_linux.dart b/packages/path_provider/path_provider_linux/lib/src/path_provider_linux.dart index 1544dcea2984..9bc10f8e0183 100644 --- a/packages/path_provider/path_provider_linux/lib/src/path_provider_linux.dart +++ b/packages/path_provider/path_provider_linux/lib/src/path_provider_linux.dart @@ -71,6 +71,18 @@ class PathProviderLinux extends PathProviderPlatform { return Future.value(xdg.getUserDirectory('DOCUMENTS')?.path); } + @override + Future getApplicationCachePath() async { + final Directory directory = + Directory(path.join(xdg.cacheHome.path, await _getId())); + if (directory.existsSync()) { + return directory.path; + } + + await directory.create(recursive: true); + return directory.path; + } + @override Future getDownloadsPath() { return Future.value(xdg.getUserDirectory('DOWNLOAD')?.path); diff --git a/packages/path_provider/path_provider_linux/pubspec.yaml b/packages/path_provider/path_provider_linux/pubspec.yaml index a72228fd93d4..7a7da2f3a988 100644 --- a/packages/path_provider/path_provider_linux/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider_linux description: Linux implementation of the path_provider plugin repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_linux issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22 -version: 2.1.11 +version: 2.2.0 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/packages/path_provider/path_provider_linux/pubspec_overrides.yaml b/packages/path_provider/path_provider_linux/pubspec_overrides.yaml new file mode 100644 index 000000000000..462aee402acb --- /dev/null +++ b/packages/path_provider/path_provider_linux/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + path_provider_platform_interface: + path: ../path_provider_platform_interface diff --git a/packages/path_provider/path_provider_linux/test/path_provider_linux_test.dart b/packages/path_provider/path_provider_linux/test/path_provider_linux_test.dart index 1f567c00513d..b5dfcce15012 100644 --- a/packages/path_provider/path_provider_linux/test/path_provider_linux_test.dart +++ b/packages/path_provider/path_provider_linux/test/path_provider_linux_test.dart @@ -57,6 +57,13 @@ void main() { expect(await plugin.getApplicationDocumentsPath(), startsWith('/')); }); + test('getApplicationCachePath', () async { + final PathProviderPlatform plugin = PathProviderLinux.private( + executableName: 'path_provider_linux_test_binary'); + expect(await plugin.getApplicationCachePath(), + '${xdg.cacheHome.path}/path_provider_linux_test_binary'); + }); + test('getDownloadsPath', () async { final PathProviderPlatform plugin = PathProviderPlatform.instance; expect(await plugin.getDownloadsPath(), startsWith('/')); diff --git a/packages/path_provider/path_provider_platform_interface/CHANGELOG.md b/packages/path_provider/path_provider_platform_interface/CHANGELOG.md index f96711be4fdd..051c0e5323cf 100644 --- a/packages/path_provider/path_provider_platform_interface/CHANGELOG.md +++ b/packages/path_provider/path_provider_platform_interface/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 2.1.0 +* Adds getApplicationCachePath() for storing app-specific cache files. * Updates minimum supported SDK version to Flutter 3.3/Dart 2.18. * Aligns Dart and Flutter SDK constraints. diff --git a/packages/path_provider/path_provider_platform_interface/lib/path_provider_platform_interface.dart b/packages/path_provider/path_provider_platform_interface/lib/path_provider_platform_interface.dart index 517ac74d8fa0..682d1ef0387d 100644 --- a/packages/path_provider/path_provider_platform_interface/lib/path_provider_platform_interface.dart +++ b/packages/path_provider/path_provider_platform_interface/lib/path_provider_platform_interface.dart @@ -62,6 +62,12 @@ abstract class PathProviderPlatform extends PlatformInterface { 'getApplicationDocumentsPath() has not been implemented.'); } + /// Path to a directory where application specific cache data can be stored. + Future getApplicationCachePath() { + throw UnimplementedError( + 'getApplicationCachePath() has not been implemented.'); + } + /// Path to a directory where the application may access top level storage. /// The current operating system should be determined before issuing this /// function call, as this functionality is only available on Android. diff --git a/packages/path_provider/path_provider_platform_interface/lib/src/enums.dart b/packages/path_provider/path_provider_platform_interface/lib/src/enums.dart index e355d7d1a5be..6c921079d867 100644 --- a/packages/path_provider/path_provider_platform_interface/lib/src/enums.dart +++ b/packages/path_provider/path_provider_platform_interface/lib/src/enums.dart @@ -50,4 +50,7 @@ enum StorageDirectory { /// Holds user-created documents. See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_DOCUMENTS. documents, + + /// Holds application cache files. + cache, } diff --git a/packages/path_provider/path_provider_platform_interface/lib/src/method_channel_path_provider.dart b/packages/path_provider/path_provider_platform_interface/lib/src/method_channel_path_provider.dart index 991be55bce8c..02729f896168 100644 --- a/packages/path_provider/path_provider_platform_interface/lib/src/method_channel_path_provider.dart +++ b/packages/path_provider/path_provider_platform_interface/lib/src/method_channel_path_provider.dart @@ -52,6 +52,11 @@ class MethodChannelPathProvider extends PathProviderPlatform { .invokeMethod('getApplicationDocumentsDirectory'); } + @override + Future getApplicationCachePath() { + return methodChannel.invokeMethod('getApplicationCacheDirectory'); + } + @override Future getExternalStoragePath() { if (!_platform.isAndroid) { diff --git a/packages/path_provider/path_provider_platform_interface/pubspec.yaml b/packages/path_provider/path_provider_platform_interface/pubspec.yaml index 193bb85b94a4..44eb59aa4a66 100644 --- a/packages/path_provider/path_provider_platform_interface/pubspec.yaml +++ b/packages/path_provider/path_provider_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/path_provider issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.0.6 +version: 2.1.0 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/packages/path_provider/path_provider_platform_interface/test/method_channel_path_provider_test.dart b/packages/path_provider/path_provider_platform_interface/test/method_channel_path_provider_test.dart index 035e7becb9ff..2c68ec574c8a 100644 --- a/packages/path_provider/path_provider_platform_interface/test/method_channel_path_provider_test.dart +++ b/packages/path_provider/path_provider_platform_interface/test/method_channel_path_provider_test.dart @@ -14,6 +14,7 @@ void main() { const String kApplicationSupportPath = 'applicationSupportPath'; const String kLibraryPath = 'libraryPath'; const String kApplicationDocumentsPath = 'applicationDocumentsPath'; + const String kApplicationCachePath = 'applicationCachePath'; const String kExternalCachePaths = 'externalCachePaths'; const String kExternalStoragePaths = 'externalStoragePaths'; const String kDownloadsPath = 'downloadsPath'; @@ -39,6 +40,8 @@ void main() { return kLibraryPath; case 'getApplicationDocumentsDirectory': return kApplicationDocumentsPath; + case 'getApplicationCacheDirectory': + return kApplicationCachePath; case 'getExternalStorageDirectories': return [kExternalStoragePaths]; case 'getExternalCacheDirectories': @@ -126,6 +129,18 @@ void main() { expect(path, kApplicationDocumentsPath); }); + test('getApplicationCachePath succeeds', () async { + final String? result = + await methodChannelPathProvider.getApplicationCachePath(); + expect( + log, + [ + isMethodCall('getApplicationCacheDirectory', arguments: null) + ], + ); + expect(result, kApplicationCachePath); + }); + test('getExternalCachePaths android succeeds', () async { final List? result = await methodChannelPathProvider.getExternalCachePaths(); diff --git a/packages/path_provider/path_provider_windows/CHANGELOG.md b/packages/path_provider/path_provider_windows/CHANGELOG.md index 6011789c0c01..04a201f11280 100644 --- a/packages/path_provider/path_provider_windows/CHANGELOG.md +++ b/packages/path_provider/path_provider_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.2.0 + +* Adds getApplicationCachePath() for storing app-specific cache files. + ## 2.1.7 * Adds compatibility with `win32` 5.x. diff --git a/packages/path_provider/path_provider_windows/example/integration_test/path_provider_test.dart b/packages/path_provider/path_provider_windows/example/integration_test/path_provider_test.dart index a8285963adb6..0e900224be7a 100644 --- a/packages/path_provider/path_provider_windows/example/integration_test/path_provider_test.dart +++ b/packages/path_provider/path_provider_windows/example/integration_test/path_provider_test.dart @@ -28,6 +28,12 @@ void main() { _verifySampleFile(result, 'applicationSupport'); }); + testWidgets('getApplicationCacheDirectory', (WidgetTester tester) async { + final PathProviderWindows provider = PathProviderWindows(); + final String? result = await provider.getApplicationCachePath(); + _verifySampleFile(result, 'applicationCache'); + }); + testWidgets('getDownloadsDirectory', (WidgetTester tester) async { final PathProviderWindows provider = PathProviderWindows(); final String? result = await provider.getDownloadsPath(); diff --git a/packages/path_provider/path_provider_windows/example/lib/main.dart b/packages/path_provider/path_provider_windows/example/lib/main.dart index e910732eb868..53e46e517d06 100644 --- a/packages/path_provider/path_provider_windows/example/lib/main.dart +++ b/packages/path_provider/path_provider_windows/example/lib/main.dart @@ -24,6 +24,7 @@ class _MyAppState extends State { String? _downloadsDirectory = 'Unknown'; String? _appSupportDirectory = 'Unknown'; String? _documentsDirectory = 'Unknown'; + String? _cacheDirectory = 'Unknown'; @override void initState() { @@ -37,6 +38,7 @@ class _MyAppState extends State { String? downloadsDirectory; String? appSupportDirectory; String? documentsDirectory; + String? cacheDirectory; final PathProviderWindows provider = PathProviderWindows(); try { @@ -62,11 +64,18 @@ class _MyAppState extends State { appSupportDirectory = 'Failed to get app support directory: $exception'; } + try { + cacheDirectory = await provider.getApplicationCachePath(); + } catch (exception) { + cacheDirectory = 'Failed to get cache directory: $exception'; + } + setState(() { _tempDirectory = tempDirectory; _downloadsDirectory = downloadsDirectory; _appSupportDirectory = appSupportDirectory; _documentsDirectory = documentsDirectory; + _cacheDirectory = cacheDirectory; }); } @@ -84,6 +93,7 @@ class _MyAppState extends State { Text('Documents Directory: $_documentsDirectory\n'), Text('Downloads Directory: $_downloadsDirectory\n'), Text('Application Support Directory: $_appSupportDirectory\n'), + Text('Cache Directory: $_cacheDirectory\n'), ], ), ), diff --git a/packages/path_provider/path_provider_windows/example/pubspec_overrides.yaml b/packages/path_provider/path_provider_windows/example/pubspec_overrides.yaml new file mode 100644 index 000000000000..6d6b19a58b14 --- /dev/null +++ b/packages/path_provider/path_provider_windows/example/pubspec_overrides.yaml @@ -0,0 +1,5 @@ +dependency_overrides: + path_provider_platform_interface: + path: ../../path_provider_platform_interface + path_provider_windows: + path: ../../path_provider_windows diff --git a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart index 691d7a2da84b..6e8ab7abfd78 100644 --- a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart +++ b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart @@ -138,6 +138,26 @@ class PathProviderWindows extends PathProviderPlatform { Future getApplicationDocumentsPath() => getPath(WindowsKnownFolder.Documents); + @override + Future getApplicationCachePath() async { + final String? appDataRoot = await getPath(WindowsKnownFolder.LocalAppData); + if (appDataRoot == null) { + return null; + } + final Directory directory = Directory( + path.join(appDataRoot, _getApplicationSpecificSubdirectory())); + // Ensure that the directory exists if possible, since it will on other + // platforms. If the name is longer than MAXPATH, creating will fail, so + // skip that step; it's up to the client to decide what to do with the path + // in that case (e.g., using a short path). + if (directory.path.length <= MAX_PATH) { + if (!directory.existsSync()) { + await directory.create(recursive: true); + } + } + return directory.path; + } + @override Future getDownloadsPath() => getPath(WindowsKnownFolder.Downloads); diff --git a/packages/path_provider/path_provider_windows/pubspec.yaml b/packages/path_provider/path_provider_windows/pubspec.yaml index 4e00b93cd4f6..d0c0f4957e9a 100644 --- a/packages/path_provider/path_provider_windows/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider_windows description: Windows implementation of the path_provider plugin repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_windows issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22 -version: 2.1.7 +version: 2.2.0 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/packages/path_provider/path_provider_windows/pubspec_overrides.yaml b/packages/path_provider/path_provider_windows/pubspec_overrides.yaml new file mode 100644 index 000000000000..462aee402acb --- /dev/null +++ b/packages/path_provider/path_provider_windows/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + path_provider_platform_interface: + path: ../path_provider_platform_interface diff --git a/packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart b/packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart index 48e56406c14f..dd8fead6668c 100644 --- a/packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart +++ b/packages/path_provider/path_provider_windows/test/path_provider_windows_test.dart @@ -165,6 +165,20 @@ void main() { expect(path, contains(r'Documents')); }, skip: !Platform.isWindows); + test('getApplicationCachePath', () async { + final PathProviderWindows pathProvider = PathProviderWindows(); + pathProvider.versionInfoQuerier = FakeVersionInfoQuerier({ + 'CompanyName': 'A Company', + 'ProductName': 'Amazing App', + }, encoding: encodingCP1252); + final String? path = await pathProvider.getApplicationCachePath(); + expect(path, isNotNull); + if (path != null) { + expect(path, endsWith(r'AppData\Local\A Company\Amazing App')); + expect(Directory(path).existsSync(), isTrue); + } + }, skip: !Platform.isWindows); + test('getDownloadsPath', () async { final PathProviderWindows pathProvider = PathProviderWindows(); final String? path = await pathProvider.getDownloadsPath(); From 2c87239f462d1abbf68c2882c00a314dee18a279 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jul 2023 14:38:59 +0200 Subject: [PATCH 02/23] Remove hand-made **/pubspec overrides.yaml --- .../path_provider/example/pubspec_overrides.yaml | 9 --------- .../path_provider/path_provider/pubspec_overrides.yaml | 3 --- .../path_provider_android/example/pubspec_overrides.yaml | 5 ----- .../path_provider_android/pubspec_overrides.yaml | 3 --- .../example/pubspec_overrides.yaml | 5 ----- .../path_provider_foundation/pubspec_overrides.yaml | 3 --- .../path_provider_linux/pubspec_overrides.yaml | 3 --- .../path_provider_windows/example/pubspec_overrides.yaml | 5 ----- .../path_provider_windows/pubspec_overrides.yaml | 3 --- 9 files changed, 39 deletions(-) delete mode 100644 packages/path_provider/path_provider/example/pubspec_overrides.yaml delete mode 100644 packages/path_provider/path_provider/pubspec_overrides.yaml delete mode 100644 packages/path_provider/path_provider_android/example/pubspec_overrides.yaml delete mode 100644 packages/path_provider/path_provider_android/pubspec_overrides.yaml delete mode 100644 packages/path_provider/path_provider_foundation/example/pubspec_overrides.yaml delete mode 100644 packages/path_provider/path_provider_foundation/pubspec_overrides.yaml delete mode 100644 packages/path_provider/path_provider_linux/pubspec_overrides.yaml delete mode 100644 packages/path_provider/path_provider_windows/example/pubspec_overrides.yaml delete mode 100644 packages/path_provider/path_provider_windows/pubspec_overrides.yaml diff --git a/packages/path_provider/path_provider/example/pubspec_overrides.yaml b/packages/path_provider/path_provider/example/pubspec_overrides.yaml deleted file mode 100644 index 48933b156a7f..000000000000 --- a/packages/path_provider/path_provider/example/pubspec_overrides.yaml +++ /dev/null @@ -1,9 +0,0 @@ -dependency_overrides: - path_provider_platform_interface: - path: ../../path_provider_platform_interface - path_provider_linux: - path: ../../path_provider_linux - path_provider_foundation: - path: ../../path_provider_foundation - path_provider_windows: - path: ../../path_provider_windows diff --git a/packages/path_provider/path_provider/pubspec_overrides.yaml b/packages/path_provider/path_provider/pubspec_overrides.yaml deleted file mode 100644 index 462aee402acb..000000000000 --- a/packages/path_provider/path_provider/pubspec_overrides.yaml +++ /dev/null @@ -1,3 +0,0 @@ -dependency_overrides: - path_provider_platform_interface: - path: ../path_provider_platform_interface diff --git a/packages/path_provider/path_provider_android/example/pubspec_overrides.yaml b/packages/path_provider/path_provider_android/example/pubspec_overrides.yaml deleted file mode 100644 index 4adf33b8852d..000000000000 --- a/packages/path_provider/path_provider_android/example/pubspec_overrides.yaml +++ /dev/null @@ -1,5 +0,0 @@ -dependency_overrides: - path_provider_platform_interface: - path: ../../path_provider_platform_interface - path_provider_android: - path: ../../path_provider_android diff --git a/packages/path_provider/path_provider_android/pubspec_overrides.yaml b/packages/path_provider/path_provider_android/pubspec_overrides.yaml deleted file mode 100644 index 462aee402acb..000000000000 --- a/packages/path_provider/path_provider_android/pubspec_overrides.yaml +++ /dev/null @@ -1,3 +0,0 @@ -dependency_overrides: - path_provider_platform_interface: - path: ../path_provider_platform_interface diff --git a/packages/path_provider/path_provider_foundation/example/pubspec_overrides.yaml b/packages/path_provider/path_provider_foundation/example/pubspec_overrides.yaml deleted file mode 100644 index e24f73c519d2..000000000000 --- a/packages/path_provider/path_provider_foundation/example/pubspec_overrides.yaml +++ /dev/null @@ -1,5 +0,0 @@ -dependency_overrides: - path_provider_platform_interface: - path: ../../path_provider_platform_interface - path_provider_foundation: - path: ../../path_provider_foundation diff --git a/packages/path_provider/path_provider_foundation/pubspec_overrides.yaml b/packages/path_provider/path_provider_foundation/pubspec_overrides.yaml deleted file mode 100644 index 462aee402acb..000000000000 --- a/packages/path_provider/path_provider_foundation/pubspec_overrides.yaml +++ /dev/null @@ -1,3 +0,0 @@ -dependency_overrides: - path_provider_platform_interface: - path: ../path_provider_platform_interface diff --git a/packages/path_provider/path_provider_linux/pubspec_overrides.yaml b/packages/path_provider/path_provider_linux/pubspec_overrides.yaml deleted file mode 100644 index 462aee402acb..000000000000 --- a/packages/path_provider/path_provider_linux/pubspec_overrides.yaml +++ /dev/null @@ -1,3 +0,0 @@ -dependency_overrides: - path_provider_platform_interface: - path: ../path_provider_platform_interface diff --git a/packages/path_provider/path_provider_windows/example/pubspec_overrides.yaml b/packages/path_provider/path_provider_windows/example/pubspec_overrides.yaml deleted file mode 100644 index 6d6b19a58b14..000000000000 --- a/packages/path_provider/path_provider_windows/example/pubspec_overrides.yaml +++ /dev/null @@ -1,5 +0,0 @@ -dependency_overrides: - path_provider_platform_interface: - path: ../../path_provider_platform_interface - path_provider_windows: - path: ../../path_provider_windows diff --git a/packages/path_provider/path_provider_windows/pubspec_overrides.yaml b/packages/path_provider/path_provider_windows/pubspec_overrides.yaml deleted file mode 100644 index 462aee402acb..000000000000 --- a/packages/path_provider/path_provider_windows/pubspec_overrides.yaml +++ /dev/null @@ -1,3 +0,0 @@ -dependency_overrides: - path_provider_platform_interface: - path: ../path_provider_platform_interface From e0cf6f3e4d07170aad0db1dfa90ba2eaac4f777a Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jul 2023 14:41:21 +0200 Subject: [PATCH 03/23] Run flutter_plugin_tools.dart make-deps-path-based --- packages/path_provider/path_provider/example/pubspec.yaml | 5 +++++ packages/path_provider/path_provider/pubspec.yaml | 5 +++++ .../path_provider/path_provider_android/example/pubspec.yaml | 5 +++++ packages/path_provider/path_provider_android/pubspec.yaml | 5 +++++ .../path_provider_foundation/example/pubspec.yaml | 5 +++++ packages/path_provider/path_provider_foundation/pubspec.yaml | 5 +++++ .../path_provider/path_provider_linux/example/pubspec.yaml | 5 +++++ packages/path_provider/path_provider_linux/pubspec.yaml | 5 +++++ .../path_provider/path_provider_windows/example/pubspec.yaml | 5 +++++ packages/path_provider/path_provider_windows/pubspec.yaml | 5 +++++ .../shared_preferences_linux/example/pubspec.yaml | 5 +++++ .../shared_preferences/shared_preferences_linux/pubspec.yaml | 5 +++++ .../shared_preferences_windows/example/pubspec.yaml | 5 +++++ .../shared_preferences_windows/pubspec.yaml | 5 +++++ 14 files changed, 70 insertions(+) diff --git a/packages/path_provider/path_provider/example/pubspec.yaml b/packages/path_provider/path_provider/example/pubspec.yaml index 2dafb42a4fec..74c235bea8e9 100644 --- a/packages/path_provider/path_provider/example/pubspec.yaml +++ b/packages/path_provider/path_provider/example/pubspec.yaml @@ -27,3 +27,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_android: {path: ../../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 4f80357a590e..398e954dcc00 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -38,3 +38,8 @@ dev_dependencies: sdk: flutter plugin_platform_interface: ^2.0.0 test: ^1.16.0 + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_android: {path: ../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../path_provider/path_provider_windows}} diff --git a/packages/path_provider/path_provider_android/example/pubspec.yaml b/packages/path_provider/path_provider_android/example/pubspec.yaml index 852d1cd77128..b1837c8c2b94 100644 --- a/packages/path_provider/path_provider_android/example/pubspec.yaml +++ b/packages/path_provider/path_provider_android/example/pubspec.yaml @@ -26,3 +26,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_android: {path: ../../../path_provider/path_provider_android}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_android/pubspec.yaml b/packages/path_provider/path_provider_android/pubspec.yaml index 626cbd810552..2cdf71853ef4 100644 --- a/packages/path_provider/path_provider_android/pubspec.yaml +++ b/packages/path_provider/path_provider_android/pubspec.yaml @@ -29,3 +29,8 @@ dev_dependencies: sdk: flutter pigeon: ^9.2.4 test: ^1.16.0 + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_foundation/example/pubspec.yaml b/packages/path_provider/path_provider_foundation/example/pubspec.yaml index 65feace0df43..82f12c8e4ca9 100644 --- a/packages/path_provider/path_provider_foundation/example/pubspec.yaml +++ b/packages/path_provider/path_provider_foundation/example/pubspec.yaml @@ -26,3 +26,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_foundation/pubspec.yaml b/packages/path_provider/path_provider_foundation/pubspec.yaml index a80322c10db9..eb72fd831f3f 100644 --- a/packages/path_provider/path_provider_foundation/pubspec.yaml +++ b/packages/path_provider/path_provider_foundation/pubspec.yaml @@ -33,3 +33,8 @@ dev_dependencies: mockito: 5.4.1 path: ^1.8.0 pigeon: ^10.1.3 + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_linux/example/pubspec.yaml b/packages/path_provider/path_provider_linux/example/pubspec.yaml index cfc06b086295..9b171bca391f 100644 --- a/packages/path_provider/path_provider_linux/example/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/example/pubspec.yaml @@ -26,3 +26,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_linux/pubspec.yaml b/packages/path_provider/path_provider_linux/pubspec.yaml index 7a7da2f3a988..649455c0b3d1 100644 --- a/packages/path_provider/path_provider_linux/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/pubspec.yaml @@ -26,3 +26,8 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_windows/example/pubspec.yaml b/packages/path_provider/path_provider_windows/example/pubspec.yaml index 1aeb6537277a..a6809d86c1ab 100644 --- a/packages/path_provider/path_provider_windows/example/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/example/pubspec.yaml @@ -25,3 +25,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/path_provider/path_provider_windows/pubspec.yaml b/packages/path_provider/path_provider_windows/pubspec.yaml index d0c0f4957e9a..c8f1087372c3 100644 --- a/packages/path_provider/path_provider_windows/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/pubspec.yaml @@ -26,3 +26,8 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}} diff --git a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml index 4cf76d2249df..138702e12d6d 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml @@ -26,3 +26,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml index b4a7656e8985..1f2eaea7ce9c 100644 --- a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml @@ -27,3 +27,8 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_linux: {path: ../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}} diff --git a/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml index e082f8045a4d..35d8a161877b 100644 --- a/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml @@ -26,3 +26,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml index ea426340f0b8..a54365cd799b 100644 --- a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml @@ -27,3 +27,8 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../path_provider/path_provider_windows}} From 6c60be1ee939317c2c6a2bd3e324ecb9f86789c0 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jul 2023 14:45:00 +0200 Subject: [PATCH 04/23] Remove bogus platform checks from the example --- .../path_provider/example/lib/main.dart | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/path_provider/path_provider/example/lib/main.dart b/packages/path_provider/path_provider/example/lib/main.dart index 6b769429846e..fcf0e138a65e 100644 --- a/packages/path_provider/path_provider/example/lib/main.dart +++ b/packages/path_provider/path_provider/example/lib/main.dart @@ -218,15 +218,9 @@ class _MyHomePageState extends State { Padding( padding: const EdgeInsets.all(16.0), child: ElevatedButton( - onPressed: Platform.isLinux || - Platform.isMacOS || - Platform.isWindows - ? _requestAppCacheDirectory - : null, - child: Text( - Platform.isAndroid - ? 'Application Cache Directory unavailable' - : 'Get Application Cache Directory', + onPressed: _requestAppCacheDirectory, + child: const Text( + 'Get Application Cache Directory', ), ), ), From 0f2a87b6fe2d69dbf8b437cc217da2bbc434f2c4 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jul 2023 14:46:45 +0200 Subject: [PATCH 05/23] Remove unnecessary indirection in the Android plugin --- .../io/flutter/plugins/pathprovider/PathProviderPlugin.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java index 1ddd6e048473..4ce1ba06cfb5 100644 --- a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java +++ b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java @@ -68,7 +68,7 @@ public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { @Override public @Nullable String getApplicationCachePath() { - return getPathProviderApplicationCacheDirectory(); + return context.getCacheDir().getPath(); } @Override @@ -91,10 +91,6 @@ private String getPathProviderTemporaryDirectory() { return context.getCacheDir().getPath(); } - private String getPathProviderApplicationCacheDirectory() { - return context.getCacheDir().getPath(); - } - private String getApplicationSupportDirectory() { return PathUtils.getFilesDir(context); } From 890edb2ffa195ac46cc9c661cb653ecee8dd27fb Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jul 2023 14:48:47 +0200 Subject: [PATCH 06/23] Clean up PathProviderLinux.getApplicationCachePath() --- .../path_provider_linux/lib/src/path_provider_linux.dart | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/path_provider/path_provider_linux/lib/src/path_provider_linux.dart b/packages/path_provider/path_provider_linux/lib/src/path_provider_linux.dart index 9bc10f8e0183..59097114d3ad 100644 --- a/packages/path_provider/path_provider_linux/lib/src/path_provider_linux.dart +++ b/packages/path_provider/path_provider_linux/lib/src/path_provider_linux.dart @@ -75,11 +75,9 @@ class PathProviderLinux extends PathProviderPlatform { Future getApplicationCachePath() async { final Directory directory = Directory(path.join(xdg.cacheHome.path, await _getId())); - if (directory.existsSync()) { - return directory.path; + if (!directory.existsSync()) { + await directory.create(recursive: true); } - - await directory.create(recursive: true); return directory.path; } From 0cddfa817b0aae47ae18390f69d0eeb3cfd57f85 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jul 2023 14:55:36 +0200 Subject: [PATCH 07/23] Test that PathProviderPlatform.getApplicationCachePath() throws --- ...path_provider_platform_interface_test.dart | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 packages/path_provider/path_provider_platform_interface/test/path_provider_platform_interface_test.dart diff --git a/packages/path_provider/path_provider_platform_interface/test/path_provider_platform_interface_test.dart b/packages/path_provider/path_provider_platform_interface/test/path_provider_platform_interface_test.dart new file mode 100644 index 000000000000..9d9bc851cef2 --- /dev/null +++ b/packages/path_provider/path_provider_platform_interface/test/path_provider_platform_interface_test.dart @@ -0,0 +1,29 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter_test/flutter_test.dart'; +import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; +import 'package:path_provider_platform_interface/src/method_channel_path_provider.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + group('$PathProviderPlatform', () { + test('$MethodChannelPathProvider is the default instance', () { + expect(PathProviderPlatform.instance, isA()); + }); + + test('getApplicationCachePath throws unimplemented error', () { + final ExtendsPathProviderPlatform pathProviderPlatform = + ExtendsPathProviderPlatform(); + + expect( + () => pathProviderPlatform.getApplicationCachePath(), + throwsUnimplementedError, + ); + }); + }); +} + +class ExtendsPathProviderPlatform extends PathProviderPlatform {} From ee3666a62ad69b057dfedc50e9e07abb63de4003 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jul 2023 15:08:34 +0200 Subject: [PATCH 08/23] De-duplicate _createApplicationSubdirectory() --- .../lib/src/path_provider_windows_real.dart | 60 +++++++------------ 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart index 6e8ab7abfd78..43e25d328070 100644 --- a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart +++ b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart @@ -114,49 +114,16 @@ class PathProviderWindows extends PathProviderPlatform { } @override - Future getApplicationSupportPath() async { - final String? appDataRoot = - await getPath(WindowsKnownFolder.RoamingAppData); - if (appDataRoot == null) { - return null; - } - final Directory directory = Directory( - path.join(appDataRoot, _getApplicationSpecificSubdirectory())); - // Ensure that the directory exists if possible, since it will on other - // platforms. If the name is longer than MAXPATH, creating will fail, so - // skip that step; it's up to the client to decide what to do with the path - // in that case (e.g., using a short path). - if (directory.path.length <= MAX_PATH) { - if (!directory.existsSync()) { - await directory.create(recursive: true); - } - } - return directory.path; - } + Future getApplicationSupportPath() => + _createApplicationSubdirectory(WindowsKnownFolder.RoamingAppData); @override Future getApplicationDocumentsPath() => getPath(WindowsKnownFolder.Documents); @override - Future getApplicationCachePath() async { - final String? appDataRoot = await getPath(WindowsKnownFolder.LocalAppData); - if (appDataRoot == null) { - return null; - } - final Directory directory = Directory( - path.join(appDataRoot, _getApplicationSpecificSubdirectory())); - // Ensure that the directory exists if possible, since it will on other - // platforms. If the name is longer than MAXPATH, creating will fail, so - // skip that step; it's up to the client to decide what to do with the path - // in that case (e.g., using a short path). - if (directory.path.length <= MAX_PATH) { - if (!directory.existsSync()) { - await directory.create(recursive: true); - } - } - return directory.path; - } + Future getApplicationCachePath() => + _createApplicationSubdirectory(WindowsKnownFolder.LocalAppData); @override Future getDownloadsPath() => getPath(WindowsKnownFolder.Downloads); @@ -276,4 +243,23 @@ class PathProviderWindows extends PathProviderPlatform { } return sanitized.isEmpty ? null : sanitized; } + + Future _createApplicationSubdirectory(String folderID) async { + final String? baseDir = await getPath(folderID); + if (baseDir == null) { + return null; + } + final Directory directory = + Directory(path.join(baseDir, _getApplicationSpecificSubdirectory())); + // Ensure that the directory exists if possible, since it will on other + // platforms. If the name is longer than MAXPATH, creating will fail, so + // skip that step; it's up to the client to decide what to do with the path + // in that case (e.g., using a short path). + if (directory.path.length <= MAX_PATH) { + if (!directory.existsSync()) { + await directory.create(recursive: true); + } + } + return directory.path; + } } From 72977d57e8ca693dce075f489284a95dcf19464a Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jul 2023 20:41:13 +0200 Subject: [PATCH 09/23] Remove StorageDirectory.cache --- .../main/java/io/flutter/plugins/pathprovider/Messages.java | 3 +-- .../path_provider/path_provider_android/lib/messages.g.dart | 1 - .../path_provider_android/lib/path_provider_android.dart | 2 -- .../path_provider/path_provider_android/pigeons/messages.dart | 1 - .../path_provider_platform_interface/lib/src/enums.dart | 3 --- 5 files changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java index 422d8d40bfbc..bf953f989b6e 100644 --- a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java +++ b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java @@ -71,8 +71,7 @@ public enum StorageDirectory { MOVIES(7), DOWNLOADS(8), DCIM(9), - DOCUMENTS(10), - CACHE(11); + DOCUMENTS(10); final int index; diff --git a/packages/path_provider/path_provider_android/lib/messages.g.dart b/packages/path_provider/path_provider_android/lib/messages.g.dart index 2f84665d06ec..7c770cd5027f 100644 --- a/packages/path_provider/path_provider_android/lib/messages.g.dart +++ b/packages/path_provider/path_provider_android/lib/messages.g.dart @@ -23,7 +23,6 @@ enum StorageDirectory { downloads, dcim, documents, - cache, } class PathProviderApi { diff --git a/packages/path_provider/path_provider_android/lib/path_provider_android.dart b/packages/path_provider/path_provider_android/lib/path_provider_android.dart index c647f12b95d1..c65b0abc30b9 100644 --- a/packages/path_provider/path_provider_android/lib/path_provider_android.dart +++ b/packages/path_provider/path_provider_android/lib/path_provider_android.dart @@ -30,8 +30,6 @@ messages.StorageDirectory _convertStorageDirectory( return messages.StorageDirectory.dcim; case StorageDirectory.documents: return messages.StorageDirectory.documents; - case StorageDirectory.cache: - return messages.StorageDirectory.cache; } } diff --git a/packages/path_provider/path_provider_android/pigeons/messages.dart b/packages/path_provider/path_provider_android/pigeons/messages.dart index ff0581ad2858..6e4eb8f1956e 100644 --- a/packages/path_provider/path_provider_android/pigeons/messages.dart +++ b/packages/path_provider/path_provider_android/pigeons/messages.dart @@ -25,7 +25,6 @@ enum StorageDirectory { downloads, dcim, documents, - cache, } @HostApi(dartHostTestHandler: 'TestPathProviderApi') diff --git a/packages/path_provider/path_provider_platform_interface/lib/src/enums.dart b/packages/path_provider/path_provider_platform_interface/lib/src/enums.dart index 6c921079d867..e355d7d1a5be 100644 --- a/packages/path_provider/path_provider_platform_interface/lib/src/enums.dart +++ b/packages/path_provider/path_provider_platform_interface/lib/src/enums.dart @@ -50,7 +50,4 @@ enum StorageDirectory { /// Holds user-created documents. See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_DOCUMENTS. documents, - - /// Holds application cache files. - cache, } From dacf2beeacbdc3fbcaae629f2342dc7eaf9a2484 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jul 2023 20:49:01 +0200 Subject: [PATCH 10/23] Fix typo --- .../path_provider/path_provider_linux/example/lib/main.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/path_provider/path_provider_linux/example/lib/main.dart b/packages/path_provider/path_provider_linux/example/lib/main.dart index 0c8d214f3fd2..3cbb6915277f 100644 --- a/packages/path_provider/path_provider_linux/example/lib/main.dart +++ b/packages/path_provider/path_provider_linux/example/lib/main.dart @@ -67,7 +67,7 @@ class _MyAppState extends State { try { appCacheDirectory = await _provider.getApplicationCachePath(); } on PlatformException { - appCacheDirectory = 'Failed to get cacge directory.'; + appCacheDirectory = 'Failed to get cache directory.'; } // If the widget was removed from the tree while the asynchronous platform // message was in flight, we want to discard the reply rather than calling From b8b25c986426cfb599ae8586f05c19cbd29d1ac3 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jul 2023 22:00:43 +0200 Subject: [PATCH 11/23] Try re-running flutter_plugin_tools.dart make-deps-path-based --- packages/camera/camera/example/pubspec.yaml | 5 +++++ packages/camera/camera_android/example/pubspec.yaml | 5 +++++ packages/camera/camera_avfoundation/example/pubspec.yaml | 5 +++++ packages/file_selector/file_selector/example/pubspec.yaml | 5 +++++ packages/path_provider/path_provider/example/pubspec.yaml | 2 +- packages/rfw/example/remote/pubspec.yaml | 5 +++++ packages/rfw/example/wasm/pubspec.yaml | 5 +++++ packages/video_player/video_player/example/pubspec.yaml | 5 +++++ .../video_player/video_player_android/example/pubspec.yaml | 5 +++++ .../video_player_avfoundation/example/pubspec.yaml | 5 +++++ .../webview_flutter/webview_flutter/example/pubspec.yaml | 5 +++++ .../webview_flutter_android/example/pubspec.yaml | 5 +++++ .../webview_flutter_wkwebview/example/pubspec.yaml | 5 +++++ 13 files changed, 61 insertions(+), 1 deletion(-) diff --git a/packages/camera/camera/example/pubspec.yaml b/packages/camera/camera/example/pubspec.yaml index 41ed519cd170..5f7e63384e59 100644 --- a/packages/camera/camera/example/pubspec.yaml +++ b/packages/camera/camera/example/pubspec.yaml @@ -30,3 +30,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/camera/camera_android/example/pubspec.yaml b/packages/camera/camera_android/example/pubspec.yaml index bee460e92fa5..43bffe9b3a5f 100644 --- a/packages/camera/camera_android/example/pubspec.yaml +++ b/packages/camera/camera_android/example/pubspec.yaml @@ -32,3 +32,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/camera/camera_avfoundation/example/pubspec.yaml b/packages/camera/camera_avfoundation/example/pubspec.yaml index b1b161655173..f3fff26245ee 100644 --- a/packages/camera/camera_avfoundation/example/pubspec.yaml +++ b/packages/camera/camera_avfoundation/example/pubspec.yaml @@ -30,3 +30,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/file_selector/file_selector/example/pubspec.yaml b/packages/file_selector/file_selector/example/pubspec.yaml index f4de9cbc743f..630af66b7f49 100644 --- a/packages/file_selector/file_selector/example/pubspec.yaml +++ b/packages/file_selector/file_selector/example/pubspec.yaml @@ -27,3 +27,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/path_provider/path_provider/example/pubspec.yaml b/packages/path_provider/path_provider/example/pubspec.yaml index 74c235bea8e9..2bee60112524 100644 --- a/packages/path_provider/path_provider/example/pubspec.yaml +++ b/packages/path_provider/path_provider/example/pubspec.yaml @@ -31,4 +31,4 @@ flutter: # FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. # See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins dependency_overrides: - {path_provider_android: {path: ../../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_android: {path: ../../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/rfw/example/remote/pubspec.yaml b/packages/rfw/example/remote/pubspec.yaml index a801d881cc82..6a3d442d457d 100644 --- a/packages/rfw/example/remote/pubspec.yaml +++ b/packages/rfw/example/remote/pubspec.yaml @@ -17,3 +17,8 @@ dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/rfw/example/wasm/pubspec.yaml b/packages/rfw/example/wasm/pubspec.yaml index 84fa83b971f5..046660e86273 100644 --- a/packages/rfw/example/wasm/pubspec.yaml +++ b/packages/rfw/example/wasm/pubspec.yaml @@ -18,3 +18,8 @@ dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/video_player/video_player/example/pubspec.yaml b/packages/video_player/video_player/example/pubspec.yaml index a45ead160452..4633562eefa7 100644 --- a/packages/video_player/video_player/example/pubspec.yaml +++ b/packages/video_player/video_player/example/pubspec.yaml @@ -35,3 +35,8 @@ flutter: - assets/bumble_bee_captions.srt - assets/bumble_bee_captions.vtt - assets/Audio.mp3 + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/video_player/video_player_android/example/pubspec.yaml b/packages/video_player/video_player_android/example/pubspec.yaml index 46df1b9f92c2..796eabafa377 100644 --- a/packages/video_player/video_player_android/example/pubspec.yaml +++ b/packages/video_player/video_player_android/example/pubspec.yaml @@ -31,3 +31,8 @@ flutter: assets: - assets/flutter-mark-square-64.png - assets/Butterfly-209.mp4 + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/video_player/video_player_avfoundation/example/pubspec.yaml b/packages/video_player/video_player_avfoundation/example/pubspec.yaml index fedf5e8f0dc2..42fbf099d63c 100644 --- a/packages/video_player/video_player_avfoundation/example/pubspec.yaml +++ b/packages/video_player/video_player_avfoundation/example/pubspec.yaml @@ -31,3 +31,8 @@ flutter: assets: - assets/flutter-mark-square-64.png - assets/Butterfly-209.mp4 + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/webview_flutter/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/webview_flutter/example/pubspec.yaml index 291fc794e4f7..518022f5af65 100644 --- a/packages/webview_flutter/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/example/pubspec.yaml @@ -36,3 +36,8 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml index 0b23ead3a90c..d82ace0088cd 100644 --- a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml @@ -33,3 +33,8 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml index aae7c82df047..0a5733d9f907 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml @@ -32,3 +32,8 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}} From 06f69b855ca3bd237d1810c7581e17096f720bbb Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Jul 2023 22:22:41 +0200 Subject: [PATCH 12/23] Revert "Try re-running flutter_plugin_tools.dart make-deps-path-based" This reverts commit b8b25c986426cfb599ae8586f05c19cbd29d1ac3. --- packages/camera/camera/example/pubspec.yaml | 5 ----- packages/camera/camera_android/example/pubspec.yaml | 5 ----- packages/camera/camera_avfoundation/example/pubspec.yaml | 5 ----- packages/file_selector/file_selector/example/pubspec.yaml | 5 ----- packages/path_provider/path_provider/example/pubspec.yaml | 2 +- packages/rfw/example/remote/pubspec.yaml | 5 ----- packages/rfw/example/wasm/pubspec.yaml | 5 ----- packages/video_player/video_player/example/pubspec.yaml | 5 ----- .../video_player/video_player_android/example/pubspec.yaml | 5 ----- .../video_player_avfoundation/example/pubspec.yaml | 5 ----- .../webview_flutter/webview_flutter/example/pubspec.yaml | 5 ----- .../webview_flutter_android/example/pubspec.yaml | 5 ----- .../webview_flutter_wkwebview/example/pubspec.yaml | 5 ----- 13 files changed, 1 insertion(+), 61 deletions(-) diff --git a/packages/camera/camera/example/pubspec.yaml b/packages/camera/camera/example/pubspec.yaml index 5f7e63384e59..41ed519cd170 100644 --- a/packages/camera/camera/example/pubspec.yaml +++ b/packages/camera/camera/example/pubspec.yaml @@ -30,8 +30,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/camera/camera_android/example/pubspec.yaml b/packages/camera/camera_android/example/pubspec.yaml index 43bffe9b3a5f..bee460e92fa5 100644 --- a/packages/camera/camera_android/example/pubspec.yaml +++ b/packages/camera/camera_android/example/pubspec.yaml @@ -32,8 +32,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/camera/camera_avfoundation/example/pubspec.yaml b/packages/camera/camera_avfoundation/example/pubspec.yaml index f3fff26245ee..b1b161655173 100644 --- a/packages/camera/camera_avfoundation/example/pubspec.yaml +++ b/packages/camera/camera_avfoundation/example/pubspec.yaml @@ -30,8 +30,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/file_selector/file_selector/example/pubspec.yaml b/packages/file_selector/file_selector/example/pubspec.yaml index 630af66b7f49..f4de9cbc743f 100644 --- a/packages/file_selector/file_selector/example/pubspec.yaml +++ b/packages/file_selector/file_selector/example/pubspec.yaml @@ -27,8 +27,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/path_provider/path_provider/example/pubspec.yaml b/packages/path_provider/path_provider/example/pubspec.yaml index 2bee60112524..74c235bea8e9 100644 --- a/packages/path_provider/path_provider/example/pubspec.yaml +++ b/packages/path_provider/path_provider/example/pubspec.yaml @@ -31,4 +31,4 @@ flutter: # FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. # See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_android: {path: ../../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} + {path_provider_android: {path: ../../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/rfw/example/remote/pubspec.yaml b/packages/rfw/example/remote/pubspec.yaml index 6a3d442d457d..a801d881cc82 100644 --- a/packages/rfw/example/remote/pubspec.yaml +++ b/packages/rfw/example/remote/pubspec.yaml @@ -17,8 +17,3 @@ dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/rfw/example/wasm/pubspec.yaml b/packages/rfw/example/wasm/pubspec.yaml index 046660e86273..84fa83b971f5 100644 --- a/packages/rfw/example/wasm/pubspec.yaml +++ b/packages/rfw/example/wasm/pubspec.yaml @@ -18,8 +18,3 @@ dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/video_player/video_player/example/pubspec.yaml b/packages/video_player/video_player/example/pubspec.yaml index 4633562eefa7..a45ead160452 100644 --- a/packages/video_player/video_player/example/pubspec.yaml +++ b/packages/video_player/video_player/example/pubspec.yaml @@ -35,8 +35,3 @@ flutter: - assets/bumble_bee_captions.srt - assets/bumble_bee_captions.vtt - assets/Audio.mp3 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/video_player/video_player_android/example/pubspec.yaml b/packages/video_player/video_player_android/example/pubspec.yaml index 796eabafa377..46df1b9f92c2 100644 --- a/packages/video_player/video_player_android/example/pubspec.yaml +++ b/packages/video_player/video_player_android/example/pubspec.yaml @@ -31,8 +31,3 @@ flutter: assets: - assets/flutter-mark-square-64.png - assets/Butterfly-209.mp4 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/video_player/video_player_avfoundation/example/pubspec.yaml b/packages/video_player/video_player_avfoundation/example/pubspec.yaml index 42fbf099d63c..fedf5e8f0dc2 100644 --- a/packages/video_player/video_player_avfoundation/example/pubspec.yaml +++ b/packages/video_player/video_player_avfoundation/example/pubspec.yaml @@ -31,8 +31,3 @@ flutter: assets: - assets/flutter-mark-square-64.png - assets/Butterfly-209.mp4 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/webview_flutter/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/webview_flutter/example/pubspec.yaml index 518022f5af65..291fc794e4f7 100644 --- a/packages/webview_flutter/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/example/pubspec.yaml @@ -36,8 +36,3 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml index d82ace0088cd..0b23ead3a90c 100644 --- a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml @@ -33,8 +33,3 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml index 0a5733d9f907..aae7c82df047 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml @@ -32,8 +32,3 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}} From 517ddb211e607eb15b32af079281d437478724d7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 25 Jul 2023 08:13:46 +0200 Subject: [PATCH 13/23] Override example deps --- packages/camera/camera/example/pubspec.yaml | 5 +++++ packages/camera/camera_android/example/pubspec.yaml | 5 +++++ packages/camera/camera_avfoundation/example/pubspec.yaml | 5 +++++ packages/file_selector/file_selector/example/pubspec.yaml | 5 +++++ packages/rfw/example/remote/pubspec.yaml | 5 +++++ packages/rfw/example/wasm/pubspec.yaml | 5 +++++ packages/video_player/video_player/example/pubspec.yaml | 5 +++++ .../video_player/video_player_android/example/pubspec.yaml | 5 +++++ .../video_player_avfoundation/example/pubspec.yaml | 5 +++++ .../webview_flutter/webview_flutter/example/pubspec.yaml | 5 +++++ .../webview_flutter_android/example/pubspec.yaml | 5 +++++ .../webview_flutter_wkwebview/example/pubspec.yaml | 5 +++++ 12 files changed, 60 insertions(+) diff --git a/packages/camera/camera/example/pubspec.yaml b/packages/camera/camera/example/pubspec.yaml index 41ed519cd170..e5a8a212506f 100644 --- a/packages/camera/camera/example/pubspec.yaml +++ b/packages/camera/camera/example/pubspec.yaml @@ -30,3 +30,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/camera/camera_android/example/pubspec.yaml b/packages/camera/camera_android/example/pubspec.yaml index bee460e92fa5..794af031878e 100644 --- a/packages/camera/camera_android/example/pubspec.yaml +++ b/packages/camera/camera_android/example/pubspec.yaml @@ -32,3 +32,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/camera/camera_avfoundation/example/pubspec.yaml b/packages/camera/camera_avfoundation/example/pubspec.yaml index b1b161655173..b061460d5605 100644 --- a/packages/camera/camera_avfoundation/example/pubspec.yaml +++ b/packages/camera/camera_avfoundation/example/pubspec.yaml @@ -30,3 +30,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/file_selector/file_selector/example/pubspec.yaml b/packages/file_selector/file_selector/example/pubspec.yaml index f4de9cbc743f..bdd96be972bb 100644 --- a/packages/file_selector/file_selector/example/pubspec.yaml +++ b/packages/file_selector/file_selector/example/pubspec.yaml @@ -27,3 +27,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/rfw/example/remote/pubspec.yaml b/packages/rfw/example/remote/pubspec.yaml index a801d881cc82..7f72c2291cf0 100644 --- a/packages/rfw/example/remote/pubspec.yaml +++ b/packages/rfw/example/remote/pubspec.yaml @@ -17,3 +17,8 @@ dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/rfw/example/wasm/pubspec.yaml b/packages/rfw/example/wasm/pubspec.yaml index 84fa83b971f5..4ed6506fba8c 100644 --- a/packages/rfw/example/wasm/pubspec.yaml +++ b/packages/rfw/example/wasm/pubspec.yaml @@ -18,3 +18,8 @@ dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/video_player/video_player/example/pubspec.yaml b/packages/video_player/video_player/example/pubspec.yaml index a45ead160452..60d0e638d932 100644 --- a/packages/video_player/video_player/example/pubspec.yaml +++ b/packages/video_player/video_player/example/pubspec.yaml @@ -35,3 +35,8 @@ flutter: - assets/bumble_bee_captions.srt - assets/bumble_bee_captions.vtt - assets/Audio.mp3 + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/video_player/video_player_android/example/pubspec.yaml b/packages/video_player/video_player_android/example/pubspec.yaml index 46df1b9f92c2..8541c45c0457 100644 --- a/packages/video_player/video_player_android/example/pubspec.yaml +++ b/packages/video_player/video_player_android/example/pubspec.yaml @@ -31,3 +31,8 @@ flutter: assets: - assets/flutter-mark-square-64.png - assets/Butterfly-209.mp4 + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/video_player/video_player_avfoundation/example/pubspec.yaml b/packages/video_player/video_player_avfoundation/example/pubspec.yaml index fedf5e8f0dc2..bbea2c1f13c1 100644 --- a/packages/video_player/video_player_avfoundation/example/pubspec.yaml +++ b/packages/video_player/video_player_avfoundation/example/pubspec.yaml @@ -31,3 +31,8 @@ flutter: assets: - assets/flutter-mark-square-64.png - assets/Butterfly-209.mp4 + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/webview_flutter/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/webview_flutter/example/pubspec.yaml index 291fc794e4f7..45f23ed32183 100644 --- a/packages/webview_flutter/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/example/pubspec.yaml @@ -36,3 +36,8 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml index 0b23ead3a90c..b42cb8409d33 100644 --- a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml @@ -33,3 +33,8 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml index aae7c82df047..04f3e9078cb5 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml @@ -32,3 +32,8 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} From 971fb72209bb555aac50a92204fce863a48968b1 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 25 Jul 2023 08:42:01 +0200 Subject: [PATCH 14/23] Run flutter_plugin_tools.dart format --- .../plugins/pathprovider/Messages.java | 88 +++++++++++-------- .../path_provider_android/lib/messages.g.dart | 21 ++--- .../test/messages_test.g.dart | 66 +++++++++----- 3 files changed, 103 insertions(+), 72 deletions(-) diff --git a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java index bf953f989b6e..1bfa729157db 100644 --- a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java +++ b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java @@ -13,14 +13,8 @@ import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MessageCodec; import io.flutter.plugin.common.StandardMessageCodec; -import java.io.ByteArrayOutputStream; -import java.nio.ByteBuffer; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -35,8 +29,7 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) - { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { super(message); this.code = code; this.details = details; @@ -55,7 +48,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @@ -82,38 +75,43 @@ private StorageDirectory(final int index) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PathProviderApi { - @Nullable + @Nullable String getTemporaryPath(); - @Nullable + @Nullable String getApplicationSupportPath(); - @Nullable + @Nullable String getApplicationDocumentsPath(); - @Nullable + @Nullable String getApplicationCachePath(); - @Nullable + @Nullable String getExternalStoragePath(); - @NonNull + @NonNull List getExternalCachePaths(); - @NonNull + @NonNull List getExternalStoragePaths(@NonNull StorageDirectory directory); /** The codec used by PathProviderApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `PathProviderApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `PathProviderApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProviderApi api) { { BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getTemporaryPath", getCodec(), taskQueue); + binaryMessenger, + "dev.flutter.pigeon.PathProviderApi.getTemporaryPath", + getCodec(), + taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -121,8 +119,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid try { String output = api.getTemporaryPath(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -136,7 +133,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath", getCodec(), taskQueue); + binaryMessenger, + "dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath", + getCodec(), + taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -144,8 +144,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid try { String output = api.getApplicationSupportPath(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -159,7 +158,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath", getCodec(), taskQueue); + binaryMessenger, + "dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath", + getCodec(), + taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -167,8 +169,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid try { String output = api.getApplicationDocumentsPath(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -182,7 +183,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getApplicationCachePath", getCodec(), taskQueue); + binaryMessenger, + "dev.flutter.pigeon.PathProviderApi.getApplicationCachePath", + getCodec(), + taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -190,8 +194,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid try { String output = api.getApplicationCachePath(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -205,7 +208,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getExternalStoragePath", getCodec(), taskQueue); + binaryMessenger, + "dev.flutter.pigeon.PathProviderApi.getExternalStoragePath", + getCodec(), + taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -213,8 +219,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid try { String output = api.getExternalStoragePath(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -228,7 +233,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getExternalCachePaths", getCodec(), taskQueue); + binaryMessenger, + "dev.flutter.pigeon.PathProviderApi.getExternalCachePaths", + getCodec(), + taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -236,8 +244,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid try { List output = api.getExternalCachePaths(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -251,18 +258,21 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths", getCodec(), taskQueue); + binaryMessenger, + "dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths", + getCodec(), + taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; - StorageDirectory directoryArg = args.get(0) == null ? null : StorageDirectory.values()[(int) args.get(0)]; + StorageDirectory directoryArg = + args.get(0) == null ? null : StorageDirectory.values()[(int) args.get(0)]; try { List output = api.getExternalStoragePaths(directoryArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } diff --git a/packages/path_provider/path_provider_android/lib/messages.g.dart b/packages/path_provider/path_provider_android/lib/messages.g.dart index 7c770cd5027f..20d4368d5d44 100644 --- a/packages/path_provider/path_provider_android/lib/messages.g.dart +++ b/packages/path_provider/path_provider_android/lib/messages.g.dart @@ -39,8 +39,7 @@ class PathProviderApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getTemporaryPath', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -61,8 +60,7 @@ class PathProviderApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -83,8 +81,7 @@ class PathProviderApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -105,8 +102,7 @@ class PathProviderApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getApplicationCachePath', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -127,8 +123,7 @@ class PathProviderApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePath', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -149,8 +144,7 @@ class PathProviderApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getExternalCachePaths', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -172,7 +166,8 @@ class PathProviderApi { } } - Future> getExternalStoragePaths(StorageDirectory arg_directory) async { + Future> getExternalStoragePaths( + StorageDirectory arg_directory) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths', codec, binaryMessenger: _binaryMessenger); diff --git a/packages/path_provider/path_provider_android/test/messages_test.g.dart b/packages/path_provider/path_provider_android/test/messages_test.g.dart index cc477ba8751b..e18fc9699969 100644 --- a/packages/path_provider/path_provider_android/test/messages_test.g.dart +++ b/packages/path_provider/path_provider_android/test/messages_test.g.dart @@ -14,7 +14,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:path_provider_android/messages.g.dart'; abstract class TestPathProviderApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); String? getTemporaryPath(); @@ -31,15 +32,19 @@ abstract class TestPathProviderApi { List getExternalStoragePaths(StorageDirectory directory); - static void setup(TestPathProviderApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestPathProviderApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PathProviderApi.getTemporaryPath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final String? output = api.getTemporaryPath(); return [output]; @@ -51,9 +56,12 @@ abstract class TestPathProviderApi { 'dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final String? output = api.getApplicationSupportPath(); return [output]; @@ -62,12 +70,16 @@ abstract class TestPathProviderApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath', codec, + 'dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final String? output = api.getApplicationDocumentsPath(); return [output]; @@ -79,9 +91,12 @@ abstract class TestPathProviderApi { 'dev.flutter.pigeon.PathProviderApi.getApplicationCachePath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final String? output = api.getApplicationCachePath(); return [output]; @@ -93,9 +108,12 @@ abstract class TestPathProviderApi { 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final String? output = api.getExternalStoragePath(); return [output]; @@ -107,9 +125,12 @@ abstract class TestPathProviderApi { 'dev.flutter.pigeon.PathProviderApi.getExternalCachePaths', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final List output = api.getExternalCachePaths(); return [output]; @@ -121,16 +142,21 @@ abstract class TestPathProviderApi { 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths was null.'); + 'Argument for dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths was null.'); final List args = (message as List?)!; - final StorageDirectory? arg_directory = args[0] == null ? null : StorageDirectory.values[args[0] as int]; + final StorageDirectory? arg_directory = + args[0] == null ? null : StorageDirectory.values[args[0] as int]; assert(arg_directory != null, 'Argument for dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths was null, expected non-null StorageDirectory.'); - final List output = api.getExternalStoragePaths(arg_directory!); + final List output = + api.getExternalStoragePaths(arg_directory!); return [output]; }); } From 040c0913b79d6967610cd9db91764d1b9383461c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 31 Jul 2023 19:14:40 +0200 Subject: [PATCH 15/23] folderID -> folderId --- .../lib/src/path_provider_windows_real.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart index 43e25d328070..2faa599a5341 100644 --- a/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart +++ b/packages/path_provider/path_provider_windows/lib/src/path_provider_windows_real.dart @@ -244,8 +244,8 @@ class PathProviderWindows extends PathProviderPlatform { return sanitized.isEmpty ? null : sanitized; } - Future _createApplicationSubdirectory(String folderID) async { - final String? baseDir = await getPath(folderID); + Future _createApplicationSubdirectory(String folderId) async { + final String? baseDir = await getPath(folderId); if (baseDir == null) { return null; } From 1a154db7f7721996744844d87e0b461c42b077c7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 31 Jul 2023 20:51:52 +0200 Subject: [PATCH 16/23] Remove dependency overrides --- packages/camera/camera/example/pubspec.yaml | 5 ----- packages/camera/camera_android/example/pubspec.yaml | 5 ----- packages/camera/camera_avfoundation/example/pubspec.yaml | 5 ----- packages/file_selector/file_selector/example/pubspec.yaml | 5 ----- packages/path_provider/path_provider/example/pubspec.yaml | 5 ----- packages/path_provider/path_provider/pubspec.yaml | 5 ----- .../path_provider/path_provider_android/example/pubspec.yaml | 5 ----- packages/path_provider/path_provider_android/pubspec.yaml | 5 ----- .../path_provider_foundation/example/pubspec.yaml | 5 ----- packages/path_provider/path_provider_foundation/pubspec.yaml | 5 ----- .../path_provider/path_provider_linux/example/pubspec.yaml | 5 ----- packages/path_provider/path_provider_linux/pubspec.yaml | 5 ----- .../path_provider/path_provider_windows/example/pubspec.yaml | 5 ----- packages/path_provider/path_provider_windows/pubspec.yaml | 5 ----- packages/rfw/example/remote/pubspec.yaml | 5 ----- packages/rfw/example/wasm/pubspec.yaml | 5 ----- .../shared_preferences_linux/example/pubspec.yaml | 5 ----- .../shared_preferences/shared_preferences_linux/pubspec.yaml | 5 ----- .../shared_preferences_windows/example/pubspec.yaml | 5 ----- .../shared_preferences_windows/pubspec.yaml | 5 ----- packages/video_player/video_player/example/pubspec.yaml | 5 ----- .../video_player/video_player_android/example/pubspec.yaml | 5 ----- .../video_player_avfoundation/example/pubspec.yaml | 5 ----- .../webview_flutter/webview_flutter/example/pubspec.yaml | 5 ----- .../webview_flutter_android/example/pubspec.yaml | 5 ----- .../webview_flutter_wkwebview/example/pubspec.yaml | 5 ----- 26 files changed, 130 deletions(-) diff --git a/packages/camera/camera/example/pubspec.yaml b/packages/camera/camera/example/pubspec.yaml index e5a8a212506f..41ed519cd170 100644 --- a/packages/camera/camera/example/pubspec.yaml +++ b/packages/camera/camera/example/pubspec.yaml @@ -30,8 +30,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/camera/camera_android/example/pubspec.yaml b/packages/camera/camera_android/example/pubspec.yaml index 794af031878e..bee460e92fa5 100644 --- a/packages/camera/camera_android/example/pubspec.yaml +++ b/packages/camera/camera_android/example/pubspec.yaml @@ -32,8 +32,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/camera/camera_avfoundation/example/pubspec.yaml b/packages/camera/camera_avfoundation/example/pubspec.yaml index b061460d5605..b1b161655173 100644 --- a/packages/camera/camera_avfoundation/example/pubspec.yaml +++ b/packages/camera/camera_avfoundation/example/pubspec.yaml @@ -30,8 +30,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/file_selector/file_selector/example/pubspec.yaml b/packages/file_selector/file_selector/example/pubspec.yaml index bdd96be972bb..f4de9cbc743f 100644 --- a/packages/file_selector/file_selector/example/pubspec.yaml +++ b/packages/file_selector/file_selector/example/pubspec.yaml @@ -27,8 +27,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider/example/pubspec.yaml b/packages/path_provider/path_provider/example/pubspec.yaml index 74c235bea8e9..2dafb42a4fec 100644 --- a/packages/path_provider/path_provider/example/pubspec.yaml +++ b/packages/path_provider/path_provider/example/pubspec.yaml @@ -27,8 +27,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_android: {path: ../../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 398e954dcc00..4f80357a590e 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -38,8 +38,3 @@ dev_dependencies: sdk: flutter plugin_platform_interface: ^2.0.0 test: ^1.16.0 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_android: {path: ../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../path_provider/path_provider_windows}} diff --git a/packages/path_provider/path_provider_android/example/pubspec.yaml b/packages/path_provider/path_provider_android/example/pubspec.yaml index b1837c8c2b94..852d1cd77128 100644 --- a/packages/path_provider/path_provider_android/example/pubspec.yaml +++ b/packages/path_provider/path_provider_android/example/pubspec.yaml @@ -26,8 +26,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_android: {path: ../../../path_provider/path_provider_android}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_android/pubspec.yaml b/packages/path_provider/path_provider_android/pubspec.yaml index 2cdf71853ef4..626cbd810552 100644 --- a/packages/path_provider/path_provider_android/pubspec.yaml +++ b/packages/path_provider/path_provider_android/pubspec.yaml @@ -29,8 +29,3 @@ dev_dependencies: sdk: flutter pigeon: ^9.2.4 test: ^1.16.0 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_foundation/example/pubspec.yaml b/packages/path_provider/path_provider_foundation/example/pubspec.yaml index 82f12c8e4ca9..65feace0df43 100644 --- a/packages/path_provider/path_provider_foundation/example/pubspec.yaml +++ b/packages/path_provider/path_provider_foundation/example/pubspec.yaml @@ -26,8 +26,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_foundation/pubspec.yaml b/packages/path_provider/path_provider_foundation/pubspec.yaml index eb72fd831f3f..a80322c10db9 100644 --- a/packages/path_provider/path_provider_foundation/pubspec.yaml +++ b/packages/path_provider/path_provider_foundation/pubspec.yaml @@ -33,8 +33,3 @@ dev_dependencies: mockito: 5.4.1 path: ^1.8.0 pigeon: ^10.1.3 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_linux/example/pubspec.yaml b/packages/path_provider/path_provider_linux/example/pubspec.yaml index 9b171bca391f..cfc06b086295 100644 --- a/packages/path_provider/path_provider_linux/example/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/example/pubspec.yaml @@ -26,8 +26,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_linux/pubspec.yaml b/packages/path_provider/path_provider_linux/pubspec.yaml index 649455c0b3d1..7a7da2f3a988 100644 --- a/packages/path_provider/path_provider_linux/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/pubspec.yaml @@ -26,8 +26,3 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}} diff --git a/packages/path_provider/path_provider_windows/example/pubspec.yaml b/packages/path_provider/path_provider_windows/example/pubspec.yaml index a6809d86c1ab..1aeb6537277a 100644 --- a/packages/path_provider/path_provider_windows/example/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/example/pubspec.yaml @@ -25,8 +25,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/path_provider/path_provider_windows/pubspec.yaml b/packages/path_provider/path_provider_windows/pubspec.yaml index c8f1087372c3..d0c0f4957e9a 100644 --- a/packages/path_provider/path_provider_windows/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/pubspec.yaml @@ -26,8 +26,3 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}} diff --git a/packages/rfw/example/remote/pubspec.yaml b/packages/rfw/example/remote/pubspec.yaml index 7f72c2291cf0..a801d881cc82 100644 --- a/packages/rfw/example/remote/pubspec.yaml +++ b/packages/rfw/example/remote/pubspec.yaml @@ -17,8 +17,3 @@ dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/rfw/example/wasm/pubspec.yaml b/packages/rfw/example/wasm/pubspec.yaml index 4ed6506fba8c..84fa83b971f5 100644 --- a/packages/rfw/example/wasm/pubspec.yaml +++ b/packages/rfw/example/wasm/pubspec.yaml @@ -18,8 +18,3 @@ dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml index 138702e12d6d..4cf76d2249df 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml @@ -26,8 +26,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml index 1f2eaea7ce9c..b4a7656e8985 100644 --- a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml @@ -27,8 +27,3 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_linux: {path: ../../path_provider/path_provider_linux}, path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}} diff --git a/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml index 35d8a161877b..e082f8045a4d 100644 --- a/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml @@ -26,8 +26,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml index a54365cd799b..ea426340f0b8 100644 --- a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml @@ -27,8 +27,3 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_platform_interface: {path: ../../path_provider/path_provider_platform_interface}, path_provider_windows: {path: ../../path_provider/path_provider_windows}} diff --git a/packages/video_player/video_player/example/pubspec.yaml b/packages/video_player/video_player/example/pubspec.yaml index 60d0e638d932..a45ead160452 100644 --- a/packages/video_player/video_player/example/pubspec.yaml +++ b/packages/video_player/video_player/example/pubspec.yaml @@ -35,8 +35,3 @@ flutter: - assets/bumble_bee_captions.srt - assets/bumble_bee_captions.vtt - assets/Audio.mp3 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/video_player/video_player_android/example/pubspec.yaml b/packages/video_player/video_player_android/example/pubspec.yaml index 8541c45c0457..46df1b9f92c2 100644 --- a/packages/video_player/video_player_android/example/pubspec.yaml +++ b/packages/video_player/video_player_android/example/pubspec.yaml @@ -31,8 +31,3 @@ flutter: assets: - assets/flutter-mark-square-64.png - assets/Butterfly-209.mp4 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/video_player/video_player_avfoundation/example/pubspec.yaml b/packages/video_player/video_player_avfoundation/example/pubspec.yaml index bbea2c1f13c1..fedf5e8f0dc2 100644 --- a/packages/video_player/video_player_avfoundation/example/pubspec.yaml +++ b/packages/video_player/video_player_avfoundation/example/pubspec.yaml @@ -31,8 +31,3 @@ flutter: assets: - assets/flutter-mark-square-64.png - assets/Butterfly-209.mp4 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/webview_flutter/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/webview_flutter/example/pubspec.yaml index 45f23ed32183..291fc794e4f7 100644 --- a/packages/webview_flutter/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/example/pubspec.yaml @@ -36,8 +36,3 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml index b42cb8409d33..0b23ead3a90c 100644 --- a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml @@ -33,8 +33,3 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml index 04f3e9078cb5..aae7c82df047 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml @@ -32,8 +32,3 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider: {path: ../../../path_provider/path_provider}, path_provider_platform_interface: {path: ../../../path_provider/path_provider_platform_interface}} From 856a10374e1c8ff691e798fc4440a181482e8f5a Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 31 Jul 2023 20:53:57 +0200 Subject: [PATCH 17/23] Bump path_provider_platform_interface to ^2.1.0 --- packages/path_provider/path_provider/example/pubspec.yaml | 2 +- packages/path_provider/path_provider/pubspec.yaml | 2 +- .../path_provider/path_provider_android/example/pubspec.yaml | 2 +- packages/path_provider/path_provider_android/pubspec.yaml | 2 +- .../path_provider/path_provider_foundation/example/pubspec.yaml | 2 +- packages/path_provider/path_provider_foundation/pubspec.yaml | 2 +- packages/path_provider/path_provider_linux/pubspec.yaml | 2 +- packages/path_provider/path_provider_windows/pubspec.yaml | 2 +- .../shared_preferences/shared_preferences_linux/pubspec.yaml | 2 +- .../shared_preferences/shared_preferences_windows/pubspec.yaml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/path_provider/path_provider/example/pubspec.yaml b/packages/path_provider/path_provider/example/pubspec.yaml index 2dafb42a4fec..5179bbf94005 100644 --- a/packages/path_provider/path_provider/example/pubspec.yaml +++ b/packages/path_provider/path_provider/example/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ - path_provider_platform_interface: ^2.0.0 + path_provider_platform_interface: ^2.1.0 dev_dependencies: build_runner: ^2.1.10 diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 4f80357a590e..5a38b40457a7 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -28,7 +28,7 @@ dependencies: path_provider_android: ^2.0.6 path_provider_foundation: ^2.1.0 path_provider_linux: ^2.0.1 - path_provider_platform_interface: ^2.0.0 + path_provider_platform_interface: ^2.1.0 path_provider_windows: ^2.0.2 dev_dependencies: diff --git a/packages/path_provider/path_provider_android/example/pubspec.yaml b/packages/path_provider/path_provider_android/example/pubspec.yaml index 852d1cd77128..df9d0e362689 100644 --- a/packages/path_provider/path_provider_android/example/pubspec.yaml +++ b/packages/path_provider/path_provider_android/example/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ - path_provider_platform_interface: ^2.0.0 + path_provider_platform_interface: ^2.1.0 dev_dependencies: flutter_test: diff --git a/packages/path_provider/path_provider_android/pubspec.yaml b/packages/path_provider/path_provider_android/pubspec.yaml index 626cbd810552..42c4ba1b1a1d 100644 --- a/packages/path_provider/path_provider_android/pubspec.yaml +++ b/packages/path_provider/path_provider_android/pubspec.yaml @@ -20,7 +20,7 @@ flutter: dependencies: flutter: sdk: flutter - path_provider_platform_interface: ^2.0.1 + path_provider_platform_interface: ^2.1.0 dev_dependencies: flutter_test: diff --git a/packages/path_provider/path_provider_foundation/example/pubspec.yaml b/packages/path_provider/path_provider_foundation/example/pubspec.yaml index 65feace0df43..51bc61d822e1 100644 --- a/packages/path_provider/path_provider_foundation/example/pubspec.yaml +++ b/packages/path_provider/path_provider_foundation/example/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ - path_provider_platform_interface: ^2.0.0 + path_provider_platform_interface: ^2.1.0 dev_dependencies: flutter_test: diff --git a/packages/path_provider/path_provider_foundation/pubspec.yaml b/packages/path_provider/path_provider_foundation/pubspec.yaml index a80322c10db9..6117963b0162 100644 --- a/packages/path_provider/path_provider_foundation/pubspec.yaml +++ b/packages/path_provider/path_provider_foundation/pubspec.yaml @@ -24,7 +24,7 @@ flutter: dependencies: flutter: sdk: flutter - path_provider_platform_interface: ^2.0.1 + path_provider_platform_interface: ^2.1.0 dev_dependencies: build_runner: ^2.3.2 diff --git a/packages/path_provider/path_provider_linux/pubspec.yaml b/packages/path_provider/path_provider_linux/pubspec.yaml index 7a7da2f3a988..b1c3e7fab8c3 100644 --- a/packages/path_provider/path_provider_linux/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: flutter: sdk: flutter path: ^1.8.0 - path_provider_platform_interface: ^2.0.0 + path_provider_platform_interface: ^2.1.0 xdg_directories: ">=0.2.0 <2.0.0" dev_dependencies: diff --git a/packages/path_provider/path_provider_windows/pubspec.yaml b/packages/path_provider/path_provider_windows/pubspec.yaml index d0c0f4957e9a..8062aa5604ee 100644 --- a/packages/path_provider/path_provider_windows/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: flutter: sdk: flutter path: ^1.8.0 - path_provider_platform_interface: ^2.0.0 + path_provider_platform_interface: ^2.1.0 win32: ">=2.1.0 <6.0.0" dev_dependencies: diff --git a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml index b4a7656e8985..beebfc0462f3 100644 --- a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: sdk: flutter path: ^1.8.0 path_provider_linux: ^2.0.0 - path_provider_platform_interface: ^2.0.0 + path_provider_platform_interface: ^2.1.0 shared_preferences_platform_interface: ^2.3.0 dev_dependencies: diff --git a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml index ea426340f0b8..90717e92ecd5 100644 --- a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: flutter: sdk: flutter path: ^1.8.0 - path_provider_platform_interface: ^2.0.0 + path_provider_platform_interface: ^2.1.0 path_provider_windows: ^2.0.0 shared_preferences_platform_interface: ^2.3.0 From 1223487bbd86fdc0d9fd69ac32ce4f0d3021754a Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 31 Jul 2023 20:59:45 +0200 Subject: [PATCH 18/23] Revert changes to shared_preferences_xxx --- .../shared_preferences/shared_preferences_linux/pubspec.yaml | 2 +- .../shared_preferences/shared_preferences_windows/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml index beebfc0462f3..b4a7656e8985 100644 --- a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: sdk: flutter path: ^1.8.0 path_provider_linux: ^2.0.0 - path_provider_platform_interface: ^2.1.0 + path_provider_platform_interface: ^2.0.0 shared_preferences_platform_interface: ^2.3.0 dev_dependencies: diff --git a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml index 90717e92ecd5..ea426340f0b8 100644 --- a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: flutter: sdk: flutter path: ^1.8.0 - path_provider_platform_interface: ^2.1.0 + path_provider_platform_interface: ^2.0.0 path_provider_windows: ^2.0.0 shared_preferences_platform_interface: ^2.3.0 From 8edccf8bbd4554bb1d5d1f7a033651c3a1b9d790 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 31 Jul 2023 21:29:22 +0200 Subject: [PATCH 19/23] Temporarily override path_provider platform packages --- packages/path_provider/path_provider/example/pubspec.yaml | 5 +++++ packages/path_provider/path_provider/pubspec.yaml | 5 +++++ .../path_provider/path_provider_android/example/pubspec.yaml | 5 +++++ .../path_provider_foundation/example/pubspec.yaml | 5 +++++ .../path_provider/path_provider_linux/example/pubspec.yaml | 5 +++++ .../path_provider/path_provider_windows/example/pubspec.yaml | 5 +++++ .../shared_preferences_linux/example/pubspec.yaml | 5 +++++ .../shared_preferences/shared_preferences_linux/pubspec.yaml | 5 +++++ .../shared_preferences_windows/example/pubspec.yaml | 5 +++++ .../shared_preferences_windows/pubspec.yaml | 5 +++++ 10 files changed, 50 insertions(+) diff --git a/packages/path_provider/path_provider/example/pubspec.yaml b/packages/path_provider/path_provider/example/pubspec.yaml index 5179bbf94005..7f6d7c8a63bc 100644 --- a/packages/path_provider/path_provider/example/pubspec.yaml +++ b/packages/path_provider/path_provider/example/pubspec.yaml @@ -27,3 +27,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_android: {path: ../../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 5a38b40457a7..b8cc4757db42 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -38,3 +38,8 @@ dev_dependencies: sdk: flutter plugin_platform_interface: ^2.0.0 test: ^1.16.0 + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_android: {path: ../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../path_provider/path_provider_linux}, path_provider_windows: {path: ../../path_provider/path_provider_windows}} diff --git a/packages/path_provider/path_provider_android/example/pubspec.yaml b/packages/path_provider/path_provider_android/example/pubspec.yaml index df9d0e362689..7fb7516209dd 100644 --- a/packages/path_provider/path_provider_android/example/pubspec.yaml +++ b/packages/path_provider/path_provider_android/example/pubspec.yaml @@ -26,3 +26,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_android: {path: ../../../path_provider/path_provider_android}} diff --git a/packages/path_provider/path_provider_foundation/example/pubspec.yaml b/packages/path_provider/path_provider_foundation/example/pubspec.yaml index 51bc61d822e1..202696680349 100644 --- a/packages/path_provider/path_provider_foundation/example/pubspec.yaml +++ b/packages/path_provider/path_provider_foundation/example/pubspec.yaml @@ -26,3 +26,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}} diff --git a/packages/path_provider/path_provider_linux/example/pubspec.yaml b/packages/path_provider/path_provider_linux/example/pubspec.yaml index cfc06b086295..a247f7aa6daa 100644 --- a/packages/path_provider/path_provider_linux/example/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/example/pubspec.yaml @@ -26,3 +26,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_linux: {path: ../../../path_provider/path_provider_linux}} diff --git a/packages/path_provider/path_provider_windows/example/pubspec.yaml b/packages/path_provider/path_provider_windows/example/pubspec.yaml index 1aeb6537277a..f7f838ed4937 100644 --- a/packages/path_provider/path_provider_windows/example/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/example/pubspec.yaml @@ -25,3 +25,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml index 4cf76d2249df..fb005e8a2027 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml @@ -26,3 +26,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_linux: {path: ../../../path_provider/path_provider_linux}} diff --git a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml index b4a7656e8985..b44b90f2280c 100644 --- a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml @@ -27,3 +27,8 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_linux: {path: ../../path_provider/path_provider_linux}} diff --git a/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml index e082f8045a4d..44a1b52b80e6 100644 --- a/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml @@ -26,3 +26,8 @@ dev_dependencies: flutter: uses-material-design: true + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml index ea426340f0b8..92fb6ced4b2e 100644 --- a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml @@ -27,3 +27,8 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {path_provider_windows: {path: ../../path_provider/path_provider_windows}} From e3c9b962f6d7ff22c69c8cf6995600a12cc8898f Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 3 Aug 2023 19:08:08 +0200 Subject: [PATCH 20/23] Update README.md: supported platforms and paths --- packages/path_provider/path_provider/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/path_provider/path_provider/README.md b/packages/path_provider/path_provider/README.md index 0c658f66a315..c76ff55c4702 100644 --- a/packages/path_provider/path_provider/README.md +++ b/packages/path_provider/path_provider/README.md @@ -35,6 +35,7 @@ Directories support by platform: | Application Support | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | Application Library | ❌️ | ✔️ | ❌️ | ✔️ | ❌️ | | Application Documents | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| Application Cache | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | External Storage | ✔️ | ❌ | ❌ | ❌️ | ❌️ | | External Cache Directories | ✔️ | ❌ | ❌ | ❌️ | ❌️ | | External Storage Directories | ✔️ | ❌ | ❌ | ❌️ | ❌️ | From da8b54e51ac41e340e340649e31a2b7081f49575 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 3 Aug 2023 19:10:20 +0200 Subject: [PATCH 21/23] Remove overrides --- packages/path_provider/path_provider/example/pubspec.yaml | 5 ----- packages/path_provider/path_provider/pubspec.yaml | 5 ----- .../path_provider_android/example/pubspec.yaml | 5 ----- .../path_provider_foundation/example/pubspec.yaml | 8 -------- .../path_provider_linux/example/pubspec.yaml | 5 ----- .../path_provider_windows/example/pubspec.yaml | 5 ----- .../shared_preferences_linux/example/pubspec.yaml | 5 ----- .../shared_preferences_linux/pubspec.yaml | 5 ----- .../shared_preferences_windows/example/pubspec.yaml | 5 ----- .../shared_preferences_windows/pubspec.yaml | 5 ----- 10 files changed, 53 deletions(-) diff --git a/packages/path_provider/path_provider/example/pubspec.yaml b/packages/path_provider/path_provider/example/pubspec.yaml index 7f6d7c8a63bc..5179bbf94005 100644 --- a/packages/path_provider/path_provider/example/pubspec.yaml +++ b/packages/path_provider/path_provider/example/pubspec.yaml @@ -27,8 +27,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_android: {path: ../../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../../path_provider/path_provider_linux}, path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index b8cc4757db42..5a38b40457a7 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -38,8 +38,3 @@ dev_dependencies: sdk: flutter plugin_platform_interface: ^2.0.0 test: ^1.16.0 - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_android: {path: ../../path_provider/path_provider_android}, path_provider_foundation: {path: ../../path_provider/path_provider_foundation}, path_provider_linux: {path: ../../path_provider/path_provider_linux}, path_provider_windows: {path: ../../path_provider/path_provider_windows}} diff --git a/packages/path_provider/path_provider_android/example/pubspec.yaml b/packages/path_provider/path_provider_android/example/pubspec.yaml index 7fb7516209dd..df9d0e362689 100644 --- a/packages/path_provider/path_provider_android/example/pubspec.yaml +++ b/packages/path_provider/path_provider_android/example/pubspec.yaml @@ -26,8 +26,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_android: {path: ../../../path_provider/path_provider_android}} diff --git a/packages/path_provider/path_provider_foundation/example/pubspec.yaml b/packages/path_provider/path_provider_foundation/example/pubspec.yaml index 202696680349..2d3ac69383c9 100644 --- a/packages/path_provider/path_provider_foundation/example/pubspec.yaml +++ b/packages/path_provider/path_provider_foundation/example/pubspec.yaml @@ -23,11 +23,3 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - -flutter: - uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_foundation: {path: ../../../path_provider/path_provider_foundation}} diff --git a/packages/path_provider/path_provider_linux/example/pubspec.yaml b/packages/path_provider/path_provider_linux/example/pubspec.yaml index a247f7aa6daa..cfc06b086295 100644 --- a/packages/path_provider/path_provider_linux/example/pubspec.yaml +++ b/packages/path_provider/path_provider_linux/example/pubspec.yaml @@ -26,8 +26,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_linux: {path: ../../../path_provider/path_provider_linux}} diff --git a/packages/path_provider/path_provider_windows/example/pubspec.yaml b/packages/path_provider/path_provider_windows/example/pubspec.yaml index f7f838ed4937..1aeb6537277a 100644 --- a/packages/path_provider/path_provider_windows/example/pubspec.yaml +++ b/packages/path_provider/path_provider_windows/example/pubspec.yaml @@ -25,8 +25,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml index fb005e8a2027..4cf76d2249df 100644 --- a/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/example/pubspec.yaml @@ -26,8 +26,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_linux: {path: ../../../path_provider/path_provider_linux}} diff --git a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml index b44b90f2280c..b4a7656e8985 100644 --- a/packages/shared_preferences/shared_preferences_linux/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_linux/pubspec.yaml @@ -27,8 +27,3 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_linux: {path: ../../path_provider/path_provider_linux}} diff --git a/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml index 44a1b52b80e6..e082f8045a4d 100644 --- a/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/example/pubspec.yaml @@ -26,8 +26,3 @@ dev_dependencies: flutter: uses-material-design: true - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_windows: {path: ../../../path_provider/path_provider_windows}} diff --git a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml index 92fb6ced4b2e..ea426340f0b8 100644 --- a/packages/shared_preferences/shared_preferences_windows/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_windows/pubspec.yaml @@ -27,8 +27,3 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - -# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. -# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins -dependency_overrides: - {path_provider_windows: {path: ../../path_provider/path_provider_windows}} From c3acbeb549d058b261d3e500d785ad4774be4b8e Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 3 Aug 2023 19:12:44 +0200 Subject: [PATCH 22/23] Bump versions --- packages/path_provider/path_provider/pubspec.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/path_provider/path_provider/pubspec.yaml b/packages/path_provider/path_provider/pubspec.yaml index 5a38b40457a7..a4502007dbe2 100644 --- a/packages/path_provider/path_provider/pubspec.yaml +++ b/packages/path_provider/path_provider/pubspec.yaml @@ -25,11 +25,11 @@ flutter: dependencies: flutter: sdk: flutter - path_provider_android: ^2.0.6 - path_provider_foundation: ^2.1.0 - path_provider_linux: ^2.0.1 + path_provider_android: ^2.1.0 + path_provider_foundation: ^2.3.0 + path_provider_linux: ^2.2.0 path_provider_platform_interface: ^2.1.0 - path_provider_windows: ^2.0.2 + path_provider_windows: ^2.2.0 dev_dependencies: flutter_test: From 5cae2733be04dbfa43904bba28322529da202ab9 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 3 Aug 2023 19:14:33 +0200 Subject: [PATCH 23/23] Fix path_provider_foundation/example/pubspec.yaml --- .../path_provider_foundation/example/pubspec.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/path_provider/path_provider_foundation/example/pubspec.yaml b/packages/path_provider/path_provider_foundation/example/pubspec.yaml index 2d3ac69383c9..51bc61d822e1 100644 --- a/packages/path_provider/path_provider_foundation/example/pubspec.yaml +++ b/packages/path_provider/path_provider_foundation/example/pubspec.yaml @@ -23,3 +23,6 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter + +flutter: + uses-material-design: true