Skip to content

Commit

Permalink
[cross_file] Improved documentation about ignored parameters in IO mo…
Browse files Browse the repository at this point in the history
…dule. (flutter#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#87812
  • Loading branch information
andreacioni committed Oct 12, 2023
1 parent d474fd3 commit d56e424
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/cross_file/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.3+6

* Improves documentation about ignored parameters in IO implementation.

## 0.3.3+5

* Adds pub topics to package metadata.
Expand Down
2 changes: 2 additions & 0 deletions packages/cross_file/lib/src/types/base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down
10 changes: 10 additions & 0 deletions packages/cross_file/lib/src/types/io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ 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.
///
/// [length] is ignored; the parameter exists only to match the web version of
/// the constructor.
///
// ignore: use_super_parameters
XFile(
String path, {
Expand All @@ -32,6 +39,9 @@ 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.
XFile.fromData(
Uint8List bytes, {
String? mimeType,
Expand Down
2 changes: 1 addition & 1 deletion packages/cross_file/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d56e424

Please sign in to comment.