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

A Flutter package for caching Lottie animations with smart update detection, automatic format handling (JSON and dotLottie), and ETag/Last-Modified based cache invalidation.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Smart Cached Network Lottie Example',
      home: Scaffold(
        appBar: AppBar(title: const Text('Smart Cached Lottie')),
        body: Center(
          child: SmartCachedNetworkLottie(
            url: "https://assets10.lottiefiles.com/packages/lf20_nfbtru7n.json",
            width: 220,
            height: 220,
            repeat: true,
            autoCheckForUpdates: false,
            onUpdate: () => print('Animation updated!'),
            errorBuilder: (context, error, stackTrace) {
              print('Error: $error');
              print('StackTrace: $stackTrace');
              return Text(
                'Error: $error',
                style: const TextStyle(color: Colors.red),
              );
            },
            loadingBuilder: (context) => const CircularProgressIndicator(),
          ),
        ),
      ),
    );
  }
}
1
likes
160
points
97
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for caching Lottie animations with smart update detection, automatic format handling (JSON and dotLottie), and ETag/Last-Modified based cache invalidation.

Repository (GitHub)
View/report issues

Topics

#lottie #cache #flutter #animation

Documentation

API reference

License

MIT (license)

Dependencies

archive, cached_network_image, flutter, flutter_cache_manager, http, lottie, path, path_provider

More

Packages that depend on smart_cached_network_lottie