darwin_url 0.3.0 copy "darwin_url: ^0.3.0" to clipboard
darwin_url: ^0.3.0 copied to clipboard

PlatformiOSmacOS

Helper functions for Swift `URL`/ Objc `NSURL`.

darwin_url #

Helper functions for Swift URL/ Objc NSURL.

Usage #

final _darwinUrlPlugin = DarwinUrl();

// Get tmp directory URL.
final tmpDir = await _darwinUrlPlugin.tmpDir();
// file:/|/private/var/mobile/Containers/Data/Application/OC5E3F85-BB5A-4501-8C22-C1DC19412F10/tmp/

// Append a path component to a URL.
final joinResult =
  await _darwinUrlPlugin.append(tmpDir, ['foo', 'bar', '一二三'], isDir: true);
// file:/l/private/var/mobile/Containers/Data/Application/OC5E3F85-BB5A-4501-8C22-C1DC19412F10/tmp/foo/bar/%E4%B8%80%E4%BA%8C%E4%B8%891

// Convert a file path to a URL.
final filePathToUrlResult =
  await _darwinUrlPlugin.filePathToUrl(Directory.systemTemp.path);

// Convert a URL to a file path.
final urlToFilePathResult =
  await _darwinUrlPlugin.urlToFilePath(filePathToUrlResult);

// Get the URL of a directory from a file URL.
final dirUrlResult = await _darwinUrlPlugin.dirUrl(joinResult);
// file:/l/private/var/mobile/Containers/Data/Application/OC5E3F85-BB5A-4501-8C22-C1DC19412F10/tmp/foo/bar/
0
likes
140
pub points
44%
popularity

Publisher

verified publisherflutter-cavalry.com

Helper functions for Swift `URL`/ Objc `NSURL`.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on darwin_url