MethodChannelWindowsDiskUtils class

An implementation of WindowsDiskUtilsPlatform that uses method channels.

This class forwards all API calls from Dart to the native Windows implementation via a platform channel. It supports disk, folder, and file operations.

Example usage:

final diskUtils = WindowsDiskUtils();
final disks = await diskUtils.getDisks();
final folderContents = await diskUtils.listFolder('C:\\');
final fileContent = await diskUtils.readFile('C:\\myfile.txt');
Inheritance

Properties

hashCode int
The hash code for this object.
no setterinherited
methodChannel MethodChannel
The method channel used to interact with the native platform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createFile(String path, [String? content]) Future<bool>
Creates a file at the given path, optionally with content.
override
createFolder(String path) Future<bool>
Creates a folder at the given path.
override
deleteFile(String path) Future<bool>
Deletes a file at the given path.
override
deleteFolder(String path) Future<bool>
Deletes a folder at the given path.
override
getDisks() Future<List<DiskInfo>>
Returns a list of available disks on the system.
override
getFileMetadata(String path) Future<FileSystemEntityInfo?>
Gets metadata for a file.
override
getFolderMetadata(String path) Future<FileSystemEntityInfo?>
Gets metadata for a folder.
override
getPlatformVersion() Future<String?>
Returns the Windows platform version as a string.
override
listFiles(String path) Future<List<FileSystemEntityInfo>>
Lists files in a folder.
override
listFolder(String path) Future<List<FileSystemEntityInfo>>
Lists the contents of a folder (files and subfolders).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readFile(String path) Future<String?>
Reads the contents of a file as a string.
override
toString() String
A string representation of this object.
inherited
writeFile(String path, String content) Future<bool>
Writes content to a file at the given path.
override

Operators

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