[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.
diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md
index 5bbb43f..94bf4b2 100644
--- a/packages/cross_file/CHANGELOG.md
+++ b/packages/cross_file/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.3.1
+
+* Fix nullability of `XFileBase`'s `path` and `name` to match the
+ implementations to avoid potential analyzer issues.
+
## 0.3.0
* Migrated package to null-safety.
diff --git a/packages/cross_file/lib/src/types/base.dart b/packages/cross_file/lib/src/types/base.dart
index 2a59c1c..4522b73 100644
--- a/packages/cross_file/lib/src/types/base.dart
+++ b/packages/cross_file/lib/src/types/base.dart
@@ -31,14 +31,14 @@
/// Accessing the data contained in the picked file by its path
/// is platform-dependant (and won't work on web), so use the
/// byte getters in the CrossFile instance instead.
- String? get path {
+ String get path {
throw UnimplementedError('.path has not been implemented.');
}
/// The name of the file as it was selected by the user in their device.
///
/// Use only for cosmetic reasons, do not try to use this as a path.
- String? get name {
+ String get name {
throw UnimplementedError('.name has not been implemented.');
}
diff --git a/packages/cross_file/pubspec.yaml b/packages/cross_file/pubspec.yaml
index 8e09b21..66d3f46 100644
--- a/packages/cross_file/pubspec.yaml
+++ b/packages/cross_file/pubspec.yaml
@@ -1,7 +1,7 @@
name: cross_file
description: An abstraction to allow working with files across multiple platforms.
homepage: https://github.com/flutter/plugins/tree/master/packages/cross_file
-version: 0.3.0
+version: 0.3.1
dependencies:
flutter: