resolve_tilde 0.0.1 copy "resolve_tilde: ^0.0.1" to clipboard
resolve_tilde: ^0.0.1 copied to clipboard

A small and simple Dart package to quickly resolve tildes in multiple platforms.

example/example.dart

import 'dart:io';

import 'package:resolve_tilde/resolve_tilde.dart';

void main() {
  print("Top-level tilde: $tilde");
  print("Static nested tilde: ${Tilde.tilde}");

  if (Platform.isWindows) {
    print("User directory: ${Tilde.resolve()}");
    print("Local AppData directory: ${Tilde.resolve("~\\AppData\\Local")}");
  } else if (Platform.isMacOS || Platform.isLinux) {
    print("User directory: ${Tilde.resolve()}");
    print("Screenshots directory: ${Tilde.resolve("~/Pictures/Screenshots")}");
  } else {
    throw UnsupportedError("Invalid platform: ${Platform.operatingSystem}");
  }
}
0
likes
160
points
1
downloads

Publisher

verified publishercalebh101.com

Weekly Downloads

A small and simple Dart package to quickly resolve tildes in multiple platforms.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on resolve_tilde