flutter_file_info 是一个 Flutter 插件,可获取详细的文件元数据,例如文件大小、创建日期和文件类型。它支持基于文件扩展名由操作系统分配的原生图标,从而在不同平台上保持视觉一致性。该插件专为 Android、iOS、macOS 和 Windows 设计,可无缝集成到文件管理应用程序中。该插件简化了对系统级文件信息的访问,无需编写平台特定代码。非常适合需要丰富文件预览或详细文件属性的应用程序。
适合场景
文件浏览器开发
媒体文件元数据提取
文件预览缩略图
跨平台文件实用工具
桌面文件管理
主要特点
按类型显示原生文件图标
跨平台支持
文件大小和时间戳检索
简单的 API 集成
可扩展的元数据访问
适合对象
开发文件浏览器的开发者
需要文件元数据的应用程序
桌面和移动文件工具
带有文件预览的 UI
需要文件信息的插件
使用建议
需要平台特定权限
仅限基本文件元数据
图标渲染可能因操作系统而异
不适用于大文件扫描
依赖于底层操作系统文件系统 API
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
flutter_file_info
A Flutter plugin for retrieving detailed file metadata, including system-native file icons. You can retrieve the native icon assigned to a file based on its type, ensuring a consistent visual representation across platforms. Perfect for applications that require access to file details and icons.
Features
Access to native file icons.
Retrieval of detailed file metadata.
Compatibility Chart
API
Android
iOS
Linux
macOS
Windows
Web
getFileIconInfo()
:heavy_check_mark:
:heavy_check_mark:
:x:
:heavy_check_mark:
:heavy_check_mark:
:x:
getFileInfo()
:heavy_check_mark:
:heavy_check_mark:
:x:
:heavy_check_mark:
:heavy_check_mark:
:x:
iOS Deployment Target
This plugin requires a minimum iOS deployment target of 13.0.
Ensure that your project is configured correctly by following these steps:
Update the Podfile
In the ios/Podfile file, set the deployment target:
platform :ios, '13.0'
After making this change, run:
cd ios && pod install
Update Xcode Project Settings
Open your project in Xcode (ios/Runner.xcworkspace).
Navigate to Runner → General.
In the Deployment Info section, set iOS Deployment Target to 13.0.
These steps ensure that your project is compatible with the required iOS version.
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.