FLUTTER ECOSYSTEM

Raincal/blurhash

圖像佔位符的緊湊表示形式。

模糊哈希 專案封面
Stars
13
Forks
19
最近推送(UTC)
2025年2月19日
專案狀態
未封存
Raincal GitHub avatar
GITHUB User

Raincal ↗

語言KotlinDartSwiftRubyHTMLObjective-C

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 8 項
  • flutter{"sdk":"flutter"}
  • flutter_web_plugins{"sdk":"flutter"}
  • web^1.0.0
  • plugin_platform_interface^2.0.2
  • blurhash_dart^1.2.0
  • image^4.0.0
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^5.0.0

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

blurhash

pub package

Compact representation of a placeholder for an image.

Platform Support
Android iOS Web
✔️ ✔️ ✔️
https://raw.githubusercontent.com/Raincal/blurhash/master/blurhash.png

Usage

To use this plugin, add blurhash as a dependency in your pubspec.yaml file.

Example
void blurHashEncode() async {
  ByteData bytes = await rootBundle.load("image.jpg");
  Uint8List pixels = bytes.buffer.asUint8List();
  var blurHash = await BlurHash.encode(pixels, 4, 3);
}

void blurHashDecode() async {
  Uint8List? imageDataBytes;
  try {
    imageDataBytes = await BlurHash.decode(blurhash, 20, 12);
  } on PlatformException catch (e) {
    throw Exception(e.message);
  }
}