IpfsPlatform class abstract
Abstract class representing platform-specific operations.
These methods are implemented differently across platforms (VM vs Web) to provide a unified API for file system and system operations.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isIO → bool
-
Whether the current platform is Desktop/Mobile (supports dart:io).
no setter
- isWeb → bool
-
Whether the current platform is Web.
no setter
- operatingSystem → String
-
Returns the name of the operating system.
no setter
- pathSeparator → String
-
Helper to get the path separator for the platform.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- version → String
-
Returns the version of the platform/runtime.
no setter
Methods
-
createDirectory(
String path) → Future< void> -
Returns a Future that completes when a directory is created at
path. -
createTempDirectory(
[String? prefix]) → Future< String> -
Returns a Future that resolves to the path of a newly created temporary directory
with an optional
prefix. -
delete(
String path) → Future< void> -
Returns a Future that completes when a file or directory at
pathis deleted. -
exists(
String path) → Future< bool> -
Returns a Future that resolves to
trueif a file or directory exists atpath. -
getLength(
String path) → Future< int> -
Returns a Future that resolves to the size of a file at
pathin bytes. -
listDirectory(
String path) → Future< List< String> > -
Returns a Future that resolves to a List of filenames/paths in the directory at
path. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
promptPassword(
String message) → Future< String?> - Returns a Future that resolves to a password entered by the user.
-
readBytes(
String path) → Future< Uint8List?> -
Returns a Future that resolves to the Uint8List bytes from a file at
path, ornullif the file does not exist. -
readString(
String path) → Future< String?> -
Returns a Future that resolves to the string content from a file at
path, ornullif the file does not exist. -
restrictToOwner(
String path) → Future< void> -
Best-effort restriction of a file at
pathso only the owner can read or write it (POSIX0600). -
toString(
) → String -
A string representation of this object.
inherited
-
writeBytes(
String path, Uint8List bytes) → Future< void> -
Returns a Future that completes when
bytesare written to a file atpath. -
writeString(
String path, String content) → Future< void> -
Returns a Future that completes when
contentis written to a file atpath. -
writeStringRestricted(
String path, String content) → Future< void> -
Writes
contenttopathwith owner-only permissions applied before any secret bytes reach disk.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited