A Flutter plugin for retrieving detailed file metadata, including native icons. Ideal for applications needing file information and icons.
- Access to native file icons.
- Retrieval of detailed file metadata.
API | Android | iOS | Linux | macOS | Windows | Web |
---|---|---|---|---|---|---|
getFileIconInfo() | ✔️ | ❌ | ❌ | ❌ | ✔️ | ❌ |
getFileInfo() | ✔️ | ❌ | ❌ | ❌ | ✔️ | ❌ |
Quick simple usage example:
IconInfo? _iconInfo = await FileInfo.instance.getFileIconInfo('path/to/example/file.txt');
Widget _buildFileIcon() {
if (_iconInfo == null) return const SizedBox.shrink();
return Image.memory(
_iconInfo!.pixelData,
width: _iconInfo!.width.toDouble(),
height: _iconInfo!.height.toDouble(),
);
}
FileMetadata? _fileMetatdata = await FileInfo.instance.getFileInfo('path/to/example/file.txt');
if (_fileMetatdata != null) {
print(fileMetadata.fileName); // Output: file.txt
print(fileMetadata.fileExtension); // Output: txt
print(fileMetadata.fileType); // Output: TextDocument
print(fileMetadata.creationTime?.toString()); // Output: 2024-08-01 17:16:26.500018
// ...
}
If you would like to contribute to the development of this plugin, please fork the repository and submit a pull request. For detailed contribution guidelines, please refer to the CONTRIBUTING.md file.
This plugin is licensed under the MIT License.