Skip to content

Commit d56e424

Browse files
authored
[cross_file] Improved documentation about ignored parameters in IO module. (#4416)
Hello guys, following the discussion in the issue below here I've tried to document all the ignored constructor parameters that are available but never used in the IO module. - flutter/flutter#87812
1 parent d474fd3 commit d56e424

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

packages/cross_file/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.3+6
2+
3+
* Improves documentation about ignored parameters in IO implementation.
4+
15
## 0.3.3+5
26

37
* Adds pub topics to package metadata.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ abstract class XFileBase {
3838

3939
/// The name of the file as it was selected by the user in their device.
4040
///
41+
/// For non-web implementation, this represents the last part of the filesystem path.
42+
///
4143
/// Use only for cosmetic reasons, do not try to use this as a path.
4244
String get name {
4345
throw UnimplementedError('.name has not been implemented.');

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ class XFile extends XFileBase {
1717
/// [bytes] is ignored; the parameter exists only to match the web version of
1818
/// the constructor. To construct a dart:io XFile from bytes, use
1919
/// [XFile.fromData].
20+
///
21+
/// [name] is ignored; the parameter exists only to match the web version of
22+
/// the constructor.
23+
///
24+
/// [length] is ignored; the parameter exists only to match the web version of
25+
/// the constructor.
26+
///
2027
// ignore: use_super_parameters
2128
XFile(
2229
String path, {
@@ -32,6 +39,9 @@ class XFile extends XFileBase {
3239
super(path);
3340

3441
/// Construct an CrossFile from its data
42+
///
43+
/// [name] is ignored; the parameter exists only to match the web version of
44+
/// the constructor.
3545
XFile.fromData(
3646
Uint8List bytes, {
3747
String? mimeType,

packages/cross_file/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: cross_file
22
description: An abstraction to allow working with files across multiple platforms.
33
repository: https://github.com/flutter/packages/tree/main/packages/cross_file
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+cross_file%22
5-
version: 0.3.3+5
5+
version: 0.3.3+6
66

77
environment:
88
sdk: ">=2.19.0 <4.0.0"

0 commit comments

Comments
 (0)