一個 Flutter web 插件,允許使用者直接從網頁瀏覽器中選擇圖片和影片。它提供彈性的輸出選項,可將所選媒體回傳為 Widget、File 或 Uint8List,以順暢整合至 Web 應用程式中。專為 Web 平台設計,透過支援原生檔案選擇並實現最少設定來提升使用者體驗。此插件由社群貢獻者維護,並支援現代 Web 標準。非常適合需要在瀏覽器環境中進行媒體上傳或預覽的應用。
適用情境
基於網路的照片上傳表單
用於內容創作的影片選擇
上傳前的媒體預覽
使用者個人檔案圖片自訂
互動式網路畫廊
主要特色
支援圖像和影片選擇
返回媒體作為 File 或 Uint8List
提供小部件預覽選項
針對網路平台優化
與 Flutter Web 的簡單整合
適合對象
Flutter 開發人員建構 Web 應用
需要瀏覽器媒體輸入的應用程式
需要輕量級媒體選擇器的項目
僅限網路的應用程式與媒體工作流程
尋求跨平台一致性的開發者
使用建議
僅限網頁平台
需要瀏覽器權限以存取檔案
不支援在網頁上進行攝像頭捕獲
在不同瀏覽器中可能表現出不同的行為
依賴外部 GitHub 倉庫以取得更新
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
ImagePickerWeb
This Web-Plugin allows Flutter Web to pick images (as File, Widget or Uint8List) and videos (as File or Uint8List). Many thanks goes to AlvaroVasconcelos for the implementation of picking images in his plugin: flutter_web_image_picker
Disclaimer for Videos
Till now [Mar. 2020] it's not possible (due to security reasons) to play a local video file (see also video_player_web). But you can retreive the file and upload them somewhere and play it as a network source.
Reminder: Don't use Uint8List retreivement for big video files! Flutter can't handle that. Pick bigger sized videos and high-resolution videos as html.File !
After you uploaded your video somewhere hosted, you can retreive the network url to play it.
MediaInfos
The methods getVideoInfo and getImageInfo are also available and you can use them to retreive further informations about your picked source.