Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 98e289b

Browse files
[cross_file] Fix base class nullability (#3629)
Without this, the dummy ("interface") XFile implementation of these properties has different nullability than the others, and the analyzer doesn't match what the runtime actually sees.
1 parent 494e9f9 commit 98e289b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

packages/cross_file/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.3.1
2+
3+
* Fix nullability of `XFileBase`'s `path` and `name` to match the
4+
implementations to avoid potential analyzer issues.
5+
16
## 0.3.0
27

38
* Migrated package to null-safety.

packages/cross_file/lib/src/types/base.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ abstract class XFileBase {
3131
/// Accessing the data contained in the picked file by its path
3232
/// is platform-dependant (and won't work on web), so use the
3333
/// byte getters in the CrossFile instance instead.
34-
String? get path {
34+
String get path {
3535
throw UnimplementedError('.path has not been implemented.');
3636
}
3737

3838
/// The name of the file as it was selected by the user in their device.
3939
///
4040
/// Use only for cosmetic reasons, do not try to use this as a path.
41-
String? get name {
41+
String get name {
4242
throw UnimplementedError('.name has not been implemented.');
4343
}
4444

packages/cross_file/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: cross_file
22
description: An abstraction to allow working with files across multiple platforms.
33
homepage: https://github.com/flutter/plugins/tree/master/packages/cross_file
4-
version: 0.3.0
4+
version: 0.3.1
55

66
dependencies:
77
flutter:

0 commit comments

Comments
 (0)