From 2711ea8d55db7572b18ff4db977a18e5a3c3247a Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Sun, 9 Jul 2023 22:53:03 +0200 Subject: [PATCH 01/16] 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 8e519f7c91c..f9ed7500292 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 597a2f8b69e..483ae99a1e9 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 51a4e442f1b..7da1b211355 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 02/16] 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 483ae99a1e9..06488e66f37 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 03/16] 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 f9ed7500292..b1491e4874b 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 04/16] 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 b1491e4874b..f9ed7500292 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 7da1b211355..51a4e442f1b 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 05/16] 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 51a4e442f1b..7da1b211355 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 06/16] 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 f9ed7500292..5c29f9da472 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 07/16] 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 cf10e70055c..0d0f16700ee 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 08/16] 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 8e519f7c91c..9f2d4d0befc 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 51a4e442f1b..6396581b09e 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" From b79f71ac37896181d72d21d8baf040a2818511b8 Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Tue, 1 Aug 2023 00:22:07 +0200 Subject: [PATCH 09/16] fix wrong version --- packages/cross_file/CHANGELOG.md | 2 +- packages/cross_file/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index 7a53ee655ba..5c29f9da472 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.3.4+5 +## 0.3.3+5 * Updates minimum supported SDK version to Flutter 3.3/Dart 2.18. * Improved documentation about ignored parameters in IO module. diff --git a/packages/cross_file/pubspec.yaml b/packages/cross_file/pubspec.yaml index 6396581b09e..7da1b211355 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.4+5 +version: 0.3.3+5 environment: sdk: ">=2.18.0 <4.0.0" From 9883eb0a85a58b9c41a0019dadc9879abd04e100 Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Thu, 31 Aug 2023 00:05:38 +0200 Subject: [PATCH 10/16] remediating reported issues --- packages/cross_file/CHANGELOG.md | 2 +- packages/cross_file/lib/src/types/base.dart | 2 -- packages/cross_file/lib/src/types/io.dart | 9 +++------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index 63a5a9c2bcb..9d7a9645301 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -2,7 +2,7 @@ * Adds pub topics to package metadata. * Updates minimum supported SDK version to Flutter 3.7/Dart 2.19. -* Improved documentation about ignored parameters in IO module. +* Improves documentation about ignored parameters in IO implementation. ## 0.3.3+4 diff --git a/packages/cross_file/lib/src/types/base.dart b/packages/cross_file/lib/src/types/base.dart index 0d0f16700ee..cf10e70055c 100644 --- a/packages/cross_file/lib/src/types/base.dart +++ b/packages/cross_file/lib/src/types/base.dart @@ -44,8 +44,6 @@ 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.'); } diff --git a/packages/cross_file/lib/src/types/io.dart b/packages/cross_file/lib/src/types/io.dart index 06488e66f37..a6738cfa621 100644 --- a/packages/cross_file/lib/src/types/io.dart +++ b/packages/cross_file/lib/src/types/io.dart @@ -19,12 +19,10 @@ class XFile extends XFileBase { /// [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.** + /// the constructor. /// /// [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.** + /// the constructor. /// // ignore: use_super_parameters XFile( @@ -43,8 +41,7 @@ class XFile extends XFileBase { /// 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.** + /// the constructor. XFile.fromData( Uint8List bytes, { String? mimeType, From 6c018560d7601fb3fd322754e27a743ce847459e Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Thu, 31 Aug 2023 00:12:07 +0200 Subject: [PATCH 11/16] version NEXT --- packages/cross_file/CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index 9d7a9645301..c82eb8f2787 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,8 +1,10 @@ +## NEXT +* Improves documentation about ignored parameters in IO implementation. + ## 0.3.3+5 * Adds pub topics to package metadata. * Updates minimum supported SDK version to Flutter 3.7/Dart 2.19. -* Improves documentation about ignored parameters in IO implementation. ## 0.3.3+4 From c33dc0d3a0b5259534e22fa89360b3827e288ed7 Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Thu, 31 Aug 2023 00:14:11 +0200 Subject: [PATCH 12/16] bump version in pubspec.yaml --- 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 a942dc8c766..79067789365 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+6 environment: sdk: ">=2.19.0 <4.0.0" From 7f813fd4a1aaee1526dd8a889897b6993823d913 Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Thu, 31 Aug 2023 00:23:34 +0200 Subject: [PATCH 13/16] add empty line --- packages/cross_file/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index c82eb8f2787..995d587d4d4 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,4 +1,5 @@ ## NEXT + * Improves documentation about ignored parameters in IO implementation. ## 0.3.3+5 From 6ff1faa09b337f9f63df1fd3ee9e5425e561fa18 Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Thu, 31 Aug 2023 00:32:33 +0200 Subject: [PATCH 14/16] do not use NEXT as per guidelines --- 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 995d587d4d4..3a81184d253 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,4 +1,4 @@ -## NEXT +## 0.3.3+6 * Improves documentation about ignored parameters in IO implementation. From 66b66e53594daa230b78004ebde8c66709cb1d51 Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Mon, 18 Sep 2023 20:56:43 +0200 Subject: [PATCH 15/16] resolving PR comments --- packages/cross_file/lib/src/types/io.dart | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/cross_file/lib/src/types/io.dart b/packages/cross_file/lib/src/types/io.dart index a6738cfa621..dd44bc08645 100644 --- a/packages/cross_file/lib/src/types/io.dart +++ b/packages/cross_file/lib/src/types/io.dart @@ -92,17 +92,11 @@ class XFile extends XFileBase { @override String get path => _file.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. + /// The name extracted from the last part of [File.path]. @override String get name => _file.path.split(Platform.pathSeparator).last; - /// the [File.length]. - /// - /// **Be aware**, the length here is not the one - /// you may have passed in the constructor/factory. + /// The [File.length]. @override Future length() { if (_length != null) { From 565581618c642c8a00d71628eb1420ce33c3c8c7 Mon Sep 17 00:00:00 2001 From: Andrea Cioni Date: Thu, 21 Sep 2023 22:23:14 +0200 Subject: [PATCH 16/16] name and length documentation moved to base.dart --- packages/cross_file/lib/src/types/base.dart | 2 ++ packages/cross_file/lib/src/types/io.dart | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cross_file/lib/src/types/base.dart b/packages/cross_file/lib/src/types/base.dart index cf10e70055c..6212f4ec762 100644 --- a/packages/cross_file/lib/src/types/base.dart +++ b/packages/cross_file/lib/src/types/base.dart @@ -38,6 +38,8 @@ abstract class XFileBase { /// The name of the file as it was selected by the user in their device. /// + /// For non-web implementation, this represents the last part of the filesystem path. + /// /// Use only for cosmetic reasons, do not try to use this as a path. String get name { throw UnimplementedError('.name has not been implemented.'); diff --git a/packages/cross_file/lib/src/types/io.dart b/packages/cross_file/lib/src/types/io.dart index dd44bc08645..fc34d496669 100644 --- a/packages/cross_file/lib/src/types/io.dart +++ b/packages/cross_file/lib/src/types/io.dart @@ -92,11 +92,9 @@ class XFile extends XFileBase { @override String get path => _file.path; - /// The name extracted from the last part of [File.path]. @override String get name => _file.path.split(Platform.pathSeparator).last; - /// The [File.length]. @override Future length() { if (_length != null) {