From 2711ea8d55db7572b18ff4db977a18e5a3c3247a Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Sun, 9 Jul 2023 22:53:03 +0200 Subject: [PATCH 1/8] Improved documentation about ignored parameters in IO module. --- packages/cross_file/CHANGELOG.md | 1 + packages/cross_file/lib/src/types/io.dart | 21 +++++++++++++++++++++ packages/cross_file/pubspec.yaml | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index 8e519f7c91c3..f9ed7500292e 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,6 +1,7 @@ ## NEXT * Updates minimum supported SDK version to Flutter 3.3/Dart 2.18. +* Improved documentation about ignored parameters in IO module. ## 0.3.3+4 diff --git a/packages/cross_file/lib/src/types/io.dart b/packages/cross_file/lib/src/types/io.dart index 597a2f8b69ee..483ae99a1e90 100644 --- a/packages/cross_file/lib/src/types/io.dart +++ b/packages/cross_file/lib/src/types/io.dart @@ -17,6 +17,15 @@ class XFile extends XFileBase { /// [bytes] is ignored; the parameter exists only to match the web version of /// the constructor. To construct a dart:io XFile from bytes, use /// [XFile.fromData]. + /// + /// [name] is ignored; the parameter exists only to match the web version of + /// the constructor. **You should avoid using this parameter because it will + /// be likely removed in the future releases.** + /// + /// [length] is ignored; the parameter exists only to match the web version of + /// the constructor. **You should avoid using this parameter because it will + /// be likely removed in the future releases.** + /// // ignore: use_super_parameters XFile( String path, { @@ -32,6 +41,10 @@ class XFile extends XFileBase { super(path); /// Construct an CrossFile from its data + /// + /// [name] is ignored; the parameter exists only to match the web version of + /// the constructor. **You should avoid using this parameter because it will + /// be likely removed in the future releases.** XFile.fromData( Uint8List bytes, { String? mimeType, @@ -82,9 +95,17 @@ class XFile extends XFileBase { @override String get path => _file.path; + /// the name extracted from [path]. + /// + /// **Be aware**, the name here is not the one + /// you may have passed in the constructor/factory. @override String get name => _file.path.split(Platform.pathSeparator).last; + /// the length of the file. + /// + /// **Be aware**, the length here is not the one + /// you may have passed in the constructor/factory. @override Future length() { if (_length != null) { diff --git a/packages/cross_file/pubspec.yaml b/packages/cross_file/pubspec.yaml index 51a4e442f1b6..7da1b2113557 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+4 +version: 0.3.3+5 environment: sdk: ">=2.18.0 <4.0.0" From fff92c00a37aee110c5655aef320eb2e74f4e38c Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Sun, 9 Jul 2023 23:05:34 +0200 Subject: [PATCH 2/8] improved comments --- packages/cross_file/lib/src/types/io.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cross_file/lib/src/types/io.dart b/packages/cross_file/lib/src/types/io.dart index 483ae99a1e90..06488e66f379 100644 --- a/packages/cross_file/lib/src/types/io.dart +++ b/packages/cross_file/lib/src/types/io.dart @@ -95,14 +95,14 @@ class XFile extends XFileBase { @override String get path => _file.path; - /// the name extracted from [path]. + /// the name extracted from the last part of [File.path]. /// /// **Be aware**, the name here is not the one /// you may have passed in the constructor/factory. @override String get name => _file.path.split(Platform.pathSeparator).last; - /// the length of the file. + /// the [File.length]. /// /// **Be aware**, the length here is not the one /// you may have passed in the constructor/factory. From adbf84fbf7e8e9b7b454c6a9e1d021e3e5b211d4 Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Tue, 11 Jul 2023 20:31:39 +0200 Subject: [PATCH 3/8] fix changelog --- packages/cross_file/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index f9ed7500292e..b1491e4874b8 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,6 +1,9 @@ ## NEXT * Updates minimum supported SDK version to Flutter 3.3/Dart 2.18. + +## 0.3.3+5 + * Improved documentation about ignored parameters in IO module. ## 0.3.3+4 From bbcf8ecbd3781b0a560ec9ab354dc0bbcfd881cb Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Mon, 17 Jul 2023 18:18:18 +0200 Subject: [PATCH 4/8] removed references to a new version --- packages/cross_file/CHANGELOG.md | 3 --- packages/cross_file/pubspec.yaml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index b1491e4874b8..f9ed7500292e 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,9 +1,6 @@ ## NEXT * Updates minimum supported SDK version to Flutter 3.3/Dart 2.18. - -## 0.3.3+5 - * Improved documentation about ignored parameters in IO module. ## 0.3.3+4 diff --git a/packages/cross_file/pubspec.yaml b/packages/cross_file/pubspec.yaml index 7da1b2113557..51a4e442f1b6 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+5 +version: 0.3.3+4 environment: sdk: ">=2.18.0 <4.0.0" From 9f25c1fdbc8baffb5b8bcdb2c5938131e642646a Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Mon, 17 Jul 2023 18:23:15 +0200 Subject: [PATCH 5/8] bump version --- packages/cross_file/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cross_file/pubspec.yaml b/packages/cross_file/pubspec.yaml index 51a4e442f1b6..7da1b2113557 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+4 +version: 0.3.3+5 environment: sdk: ">=2.18.0 <4.0.0" From 694e2103f75e72e30e3089f196afea3e853e542a Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Mon, 17 Jul 2023 18:27:00 +0200 Subject: [PATCH 6/8] removed NEXT and set new version --- packages/cross_file/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index f9ed7500292e..5c29f9da4721 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,4 +1,4 @@ -## NEXT +## 0.3.3+5 * Updates minimum supported SDK version to Flutter 3.3/Dart 2.18. * Improved documentation about ignored parameters in IO module. From e38f6198a12fdaef0ac0e49c40d4221ad0d2a94f Mon Sep 17 00:00:00 2001 From: ValentinVignal Date: Sat, 22 Jul 2023 13:27:52 +0800 Subject: [PATCH 7/8] doc: Add sentence to say mime type is not intended for io implementation --- packages/cross_file/lib/src/types/base.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/cross_file/lib/src/types/base.dart b/packages/cross_file/lib/src/types/base.dart index cf10e70055c2..0d0f16700ee8 100644 --- a/packages/cross_file/lib/src/types/base.dart +++ b/packages/cross_file/lib/src/types/base.dart @@ -44,6 +44,8 @@ abstract class XFileBase { } /// For web, it may be necessary for a file to know its MIME type. + /// + /// For io implementation, this is not intended to be set and will be `null`. String? get mimeType { throw UnimplementedError('.mimeType has not been implemented.'); } From 6abf97d391854a6366fc6f31b6fc2d0d180a5255 Mon Sep 17 00:00:00 2001 From: ValentinVignal Date: Sat, 22 Jul 2023 13:31:55 +0800 Subject: [PATCH 8/8] chore: Update version --- packages/cross_file/CHANGELOG.md | 3 ++- packages/cross_file/pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index 8e519f7c91c3..9f2d4d0befc2 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 0.3.4+5 * Updates minimum supported SDK version to Flutter 3.3/Dart 2.18. +* Updates `mimeType` documentation to reflect that it is not intended to be set on io implementation. ## 0.3.3+4 diff --git a/packages/cross_file/pubspec.yaml b/packages/cross_file/pubspec.yaml index 51a4e442f1b6..6396581b09e4 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+4 +version: 0.3.4+5 environment: sdk: ">=2.18.0 <4.0.0"