MethodChannelDiskKitMacos class

macOS transport using method and event channels.

Inheritance
  • Object
  • PlatformInterface
  • DiskKitPlatform
  • MethodChannelDiskKitMacos
Implementers

Constructors

MethodChannelDiskKitMacos()
Creates a transport for the registered macOS native plugin.

Properties

eventChannel → EventChannel
Native disk snapshot channel, shared by all stream listeners.
final
hashCode → int
The hash code for this object.
no setterinherited
methodChannel → MethodChannel
Native request channel. Errors are propagated as PlatformException.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyFromDisk(String diskId, {required String relativePath, required String destinationPath}) → Future<void>
Recursively copies a file or directory from a mounted diskId. relativePath is inside the volume; destinationPath is absolute and must not exist. Its parent must exist. Reject traversal out of the volume. A failed copy can leave partial data; no overwrite or merge is performed.
override
copyToDisk(String diskId, {required String sourcePath, required String relativePath}) → Future<void>
Copies an absolute sourcePath to relativePath inside mounted diskId. The destination must not exist and its parent directory must exist. Preserves nested symlinks; reject destinations escaping the volume root. A failed copy can leave partial data; no overwrite or merge is performed.
override
eject(String diskId) → Future<void>
Eject the whole disk containing diskId. Unmount its volumes first.
override
formatDisk(String diskId, {required DiskFileSystem fileSystem, required String volumeName, DiskPartitionScheme partitionScheme = DiskPartitionScheme.gpt}) → Future<void>
Destructively replaces all partitions on the whole disk diskId. Create a data volume named volumeName with fileSystem using partitionScheme. The OS may create additional system partitions. macOS requires external media and GPT for APFS; callers confirm deletion.
override
formatVolume(String diskId, {required DiskFileSystem fileSystem, required String volumeName}) → Future<void>
Destructively replaces the filesystem on the volume identified by diskId. Preserve its partition table. fileSystem and volumeName specify the replacement. The macOS implementation requires positively external media; native permissions and filesystem/layout restrictions still apply.
override
getDisks() → Future<List<DiskInfo>>
Returns a snapshot including devices, partitions, and volumes. Implementations preserve unknown metadata as null and return immutable lists.
override
mount(String diskId) → Future<DiskInfo>
Mounts the volume identified by diskId at the default OS mount point. Returns the volume description after the native operation finishes.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
renameVolume(String diskId, {required String volumeName}) → Future<DiskInfo>
Changes the filesystem volume label to volumeName, preserving file data. Returns the updated volume description, including its current mount point. Implementations validate filesystem label rules and notify observers of description changes, including any change to the mount point.
override
toString() → String
A string representation of this object.
inherited
unmount(String diskId, {bool wholeDisk = false}) → Future<DiskInfo>
Unmount a volume, or all volumes on its whole disk if wholeDisk is true. Returns the unmounted volume, or the whole disk when wholeDisk is true. Query the snapshot stream for individual volume states after a whole-disk request. Active files can cause rejection; no force is used.
override
watchDisks() → Stream<List<DiskInfo>>
A broadcast stream with an initial snapshot and subsequent snapshots.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited