FLUTTER ECOSYSTEM

Raincal/blurhash

画像のプレースホルダのコンパクトな表現。

ブルハッシュ のプロジェクト画像
Stars
13
Forks
19
最終プッシュ(UTC)
2025/02/19
プロジェクト状態
公開中
Raincal GitHub avatar
言語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);
  }
}