imgx 0.1.5 copy "imgx: ^0.1.5" to clipboard
imgx: ^0.1.5 copied to clipboard

Flutter package for loading images from URLs (PNG, JPG, WEBP, GIF) with memory/disk caching, expiration, retry mechanism, and progress tracking for smooth server handling.

example/lib/main.dart

import 'package:example/home_page.dart';
import 'package:flutter/material.dart';
import 'package:imgx/imgx.dart';

void main() {
  ImgXConfig.globalCacheType = CacheType.memory;
  ImgXConfig.globalCacheDuration = const Duration(days: 1);
  ImgXConfig.globalProgressWidget = const Center(
    child: CircularProgressIndicator(),
  );
  ImgXConfig.globalErrorWidget = const Center(
    child: Icon(Icons.error),
  );
  ImgXConfig.globalRetryCount = 3;

  ImgX.removeCacheWhere(key: "key");
  ImgX.removeAllCache();

  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'ImgX Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const HomePage(),
    );
  }
}
4
likes
160
points
42
downloads

Publisher

verified publisherhuygenlabs.com

Weekly Downloads

Flutter package for loading images from URLs (PNG, JPG, WEBP, GIF) with memory/disk caching, expiration, retry mechanism, and progress tracking for smooth server handling.

Repository (GitHub)

Topics

#image #image-loading #image-caching #image-download #image-retry

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, http, logger, shared_preferences

More

Packages that depend on imgx