flutter_thumbhash 0.1.0+1 copy "flutter_thumbhash: ^0.1.0+1" to clipboard
flutter_thumbhash: ^0.1.0+1 copied to clipboard

Flutter implementation of ThumbHash algorithm — a very compact representation of an image placeholder.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_thumbhash/flutter_thumbhash.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final hash = ThumbHash.fromBase64('3OcRJYB4d3h/iIeHeEh3eIhw+j3A');
    return Scaffold(
      backgroundColor: hash.toAverageColor(),
      body: Image(
        image: hash.toImage(),
        height: double.infinity,
        width: double.infinity,
        fit: BoxFit.contain,
      ),
    );
  }
}
4
likes
160
points
5
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter implementation of ThumbHash algorithm — a very compact representation of an image placeholder.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, thumbhash

More

Packages that depend on flutter_thumbhash