Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/cross_file/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion packages/cross_file/lib/src/types/interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/cross_file/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions packages/cross_file/test/x_file_io_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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', () {
Expand Down Expand Up @@ -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);
Expand Down