act_thumbhash_flutter 1.0.0 copy "act_thumbhash_flutter: ^1.0.0" to clipboard
act_thumbhash_flutter: ^1.0.0 copied to clipboard

Flutter widgets and image providers for ThumbHash image placeholders. Show instant lossy previews while full images load.

example/lib/main.dart

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

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    // Example ThumbHash (base64 encoded)
    const thumbHash = '1QcSHQRnh493V4dIh4eXh1h4kJUI';
    const imageUrl = 'https://picsum.photos/400/300';

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('ThumbHash Example')),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              // Basic usage
              SizedBox(
                width: 200,
                height: 150,
                child: Image(
                  image: ThumbHashImageProvider.fromBase64(thumbHash),
                  fit: BoxFit.cover,
                ),
              ),
              const SizedBox(height: 20),
              // Progressive loading
              SizedBox(
                width: 200,
                height: 150,
                child: FadeInImage(
                  placeholder: ThumbHashImageProvider.fromBase64(thumbHash),
                  image: const NetworkImage(imageUrl),
                  fit: BoxFit.cover,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
160
points
235
downloads

Documentation

API reference

Publisher

verified publisheract-app.de

Weekly Downloads

Flutter widgets and image providers for ThumbHash image placeholders. Show instant lossy previews while full images load.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

act_thumbhash, flutter

More

Packages that depend on act_thumbhash_flutter