Skip to content

[cross_file] Add a base class feature to provide a file path  #196306

Open

Description

@bparrishMines

Currently, there is no way to know if the platform implementation for XFile.uri can be used as a file path. A file system implementation can provide a file path with FileSystemXFile.path, but a scoped storage implementation doesn't have an equivalent. For example, the URI of cross_file_darwin's security scoped implementation (a scoped storage implementation) can be used as a file path.

This issue proposes adding a new base class method that allows a platform implementation to provide a file path if possible, regardless of it being a file system or scoped storage implementation. Something along the lines of:

class PlatformXEntity {
  // ...
  String? get asFilePath => null;
}

class XEntity {
  // ...
  String? get asFilePath => platform.asFilePath;
}

comment for context: flutter/packages#13147 (comment)

Activity

  1. changed the title [-][cross_file][/-] [+][cross_file] Support providing a file path in `XFile`[/+] on Nov 10, 2026
  2. added
    P2Important issues not at the top of the work list
    on Nov 10, 2026
  3. changed the title [-][cross_file] Support providing a file path in `XFile`[/-] [+][cross_file] Add a base class feature to provide a file path for all implementations[/+] on Nov 10, 2026
  4. changed the title [-][cross_file] Add a base class feature to provide a file path for all implementations[/-] [+][cross_file] Add a base class feature to provide a file path [/+] on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityp: cross_fileThe cross_file pluginteam-ecosystemOwned by Ecosystem team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions