Skip to content

getFile VS support dirs on iOS #6810

@g123k

Description

@g123k

Hi!

This is a follow-up of the discussion in #6722.

@monsieurtanuki To be understand, please remind me what was the issue with the getFile method initially:

  static Future<File> getFile(String path) async {
    if (Platform.isIOS) {
      final int lastSeparator = path.lastIndexOf('/');
      final String filename = lastSeparator == -1
          ? path
          : path.substring(lastSeparator + 1);
      final Directory directory = await getDirectory();
      path = '${directory.path}/$filename';
    }
    return File(path);
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    💬 To discuss and validate

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions