搜尋分類、套件與程式碼儲存庫

套件詳情v2.0.1

transparent_image

Dart 程式碼中以 Uint8List 表示的透明影像。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
15.4萬
喜歡數
499
Pub 分數
140

安裝套件

flutter pub add transparent_image

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個輕量級的 Dart 套件,提供透明圖像作為 Uint8List,適用於 UI 開發中的佔位符圖像。它能在多個平台上一致地渲染無形或透明的圖像,而無需外部資源。非常適合測試、版面原型設計,或在不需要視覺內容的情況下需要圖像佔位符的場景。該套件與平台無關,可順暢整合至 Flutter 應用中。

適用情境

  • UI 測試中的佔位符圖像
  • 無視覺資產的版面原型設計
  • 測試圖像佔位符
  • 跨平台 UI 一致性
  • 需要極少的資產開銷

主要特色

  • 提供一個透明圖像作為 Uint8List
  • 無需外部資源檔案
  • 跨平台相容性
  • 輕量且簡單的 API
  • 支援所有主要的 Flutter 平台

適合對象

  • 需要圖像佔位符的開發人員
  • UI/UX 原型設計工作流程
  • 需要中性圖像的測試環境
  • 專案最小化資產大小
  • Flutter 應用針對多個平台

使用建議

  • 不適合實際圖像顯示
  • 需要手動處理圖像數據
  • 僅限透明圖像使用情境
  • 不支援圖像操作
  • 最佳用法為暫時或佔位解決方案

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

transparent_image

A simple transparent image. Represented as a Uint8List, which was originally extracted from the Flutter codebase (was private in the test package).

It's a silly, simple library, but I found I needed transparent images in a few projects and found this is the simplest way to represent it :)

Usage

This package exports one constant: kTransparentImage.

Image Widget

Displays the transparent image.

Image.memory(kTransparentImage);
ImageProvider
MemoryImage(kTransparentImage);
FadeInImage Widget

A more useful example, and the reason I originally extracted this from the Flutter codebase!

A complete example can be seen on the Flutter website.

FadeInImage.memoryNetwork(
    placeholder: kTransparentImage,
    image: 'https://picsum.photos/250?image=9',
  ),
);

Contributors

  • Flutter team
  • Brian Egan

所屬分類

原始碼儲存庫

使用此套件的專案