搜索分类、插件与代码仓

插件详情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

所属分类

源码仓库

使用此插件的项目