diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index a001f20c45c..fb2efd3f1c1 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,5 +1,10 @@ +## 0.3.3+4 + +* Reverts an accidental change in a constructor argument's nullability. + ## 0.3.3+3 +* **RETRACTED** * Updates code to fix strict-cast violations. * Updates minimum SDK version to Flutter 3.0. diff --git a/packages/cross_file/lib/src/types/interface.dart b/packages/cross_file/lib/src/types/interface.dart index 3243d88061c..c83e5734d32 100644 --- a/packages/cross_file/lib/src/types/interface.dart +++ b/packages/cross_file/lib/src/types/interface.dart @@ -22,7 +22,7 @@ class XFile extends XFileBase { /// `path` of the file doesn't match what the user sees when selecting it /// (like in web) XFile( - super.path, { + String super.path, { String? mimeType, String? name, int? length, diff --git a/packages/cross_file/pubspec.yaml b/packages/cross_file/pubspec.yaml index 099b914aa1f..e46c255ae28 100644 --- a/packages/cross_file/pubspec.yaml +++ b/packages/cross_file/pubspec.yaml @@ -2,7 +2,7 @@ name: cross_file description: An abstraction to allow working with files across multiple platforms. repository: https://github.com/flutter/packages/tree/main/packages/cross_file issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+cross_file%22 -version: 0.3.3+3 +version: 0.3.3+4 environment: sdk: ">=2.17.0 <3.0.0" diff --git a/packages/cross_file/test/x_file_io_test.dart b/packages/cross_file/test/x_file_io_test.dart index 4a676e2f880..7b730ca7655 100644 --- a/packages/cross_file/test/x_file_io_test.dart +++ b/packages/cross_file/test/x_file_io_test.dart @@ -70,6 +70,10 @@ void main() { await tempDir.delete(recursive: true); }); + + test('nullability is correct', () async { + expect(_ensureNonnullPathArgument('a/path'), isNotNull); + }); }); group('Create with data', () { @@ -107,6 +111,13 @@ void main() { }); } +// This is to create an analysis error if the version of XFile in +// interface.dart, which should never actually be used but is what the analyzer +// runs against, has the nullability of `path` changed. +XFile _ensureNonnullPathArgument(String? path) { + return XFile(path!); +} + /// An XFile subclass that tracks reads, for testing purposes. class TestXFile extends XFile { TestXFile(super.path);