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, bool parallel = true, FileCopyProgressCallback? onProgress}) → Future< void> -
Recursively copies a file or directory from a mounted
diskId.relativePathis inside the volume;destinationPathis 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, bool parallel = true, FileCopyProgressCallback? onProgress, required String relativePath}) → Future< void> -
Copies an absolute
sourcePathtorelativePathinside mounteddiskId. 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 -
createMacOSInstaller(
String diskId, {required String installerAppPath, bool allowElevation = true, MediaProgressCallback? onProgress}) → Future< void> -
Erases a whole disk and runs an Apple-signed installer's createinstallmedia.
installerAppPathnames a complete Install macOS .app, not an ISO or DMG. macOS can request administrator authorization whenallowElevationis true. Apple's tool controls copying and validation; byte counters are unavailable.override -
createWindowsInstaller(
String diskId, {required String isoPath, String? wimlibPath, bool verify = true, MediaProgressCallback? onProgress}) → Future< void> -
Erases a whole disk and copies a Windows ISO into a FAT32 UEFI layout.
Oversized install.wim needs a caller-installed wimlib-imagex executable;
wimlibPathoverrides the usual Homebrew locations. No legacy BIOS setup.verifycompares copied files and checks split WIM integrity.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 namedvolumeNamewithfileSystemusingpartitionScheme. The OS may create additional system partitions. macOS requires external media and GPT for both APFS variants; 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.fileSystemandvolumeNamespecify 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
diskIdat 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
wholeDiskis true. Returns the unmounted volume, or the whole disk whenwholeDiskis 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
-
writeImage(
String diskId, {required String imagePath, bool verify = true, bool allowElevation = true, MediaProgressCallback? onProgress}) → Future< void> -
Writes an uncompressed raw IMG or USB-compatible hybrid ISO to a whole disk.
Erases the disk layout. Ordinary Windows/macOS installer ISOs need their
dedicated installer methods instead. Verification reads back image bytes.
macOS can request administrator authorization when
allowElevationis true.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited