reusable_image_widget 0.0.9 copy "reusable_image_widget: ^0.0.9" to clipboard
reusable_image_widget: ^0.0.9 copied to clipboard

A reusable Flutter widget library for picking, cropping, compressing, and displaying images from gallery, camera, or network with full-screen preview support.

📷 reusable_image_widget #

A powerful, flexible, and platform-aware Flutter image handling package that supports displaying avatars, full-screen image viewing, file/network/asset loading, and gallery saving with minimal setup.


✨ Features #

  • ✔ Load images from XFile, network URLs, or asset paths
  • ✔ Auto-detect platform and image source
  • ✔ Full-screen image viewer with zoom, rotation, and hero animation
  • ✔ Circular or rectangular avatar widgets
  • ✔ Customizable placeholder and error widgets
  • ✔ Platform-aware image downloading (web, mobile, desktop)
  • ✔ Lightweight and easily composable

📂 Installation #

Add this to your pubspec.yaml:

dependencies:
  reusable_image_widget: ^latest_version

🌍 Cross-Platform Image Support #

Internally detects platform and source:

  • XFile (picked files)
  • Network URL
  • Asset path (starts with assets/)

Uses:

  • FileImage / Image.file
  • NetworkImage / CachedNetworkImage
  • AssetImage
  • MemoryImage (for web)

🚀 Usage #

1. Basic Usage #

AppImageViewer(
  imageSource: 'assets/images/profile_pic.jpeg',
)

2. From Picked File #

AppImageViewer(
  pickedFile: pickedFile, // XFile
)

3. Avatar Image #

AppAvatarImage(
  imageSource: 'https://example.com/image.jpg',
  radius: 48,
)

4. Full Screen Viewer #

FullScreenImageViewer(
  imageSource: 'https://example.com/image.jpg',
  heroTag: 'profile_pic',
)

🎨 Avatar Widgets #

  • AppAvatarImage — circular or rectangle with fallback
  • AppCircleAvatar
  • AppRectangleAvatar
  • AvatarImageViewer — avatar with edit icon & full-screen support

🔄 Image Download (All Platforms) #

final result = await downloadImage(
  pickedFile: pickedFile,
  imageSource: 'https://example.com/image.jpg',
);

Web Support #

Web download is handled using AnchorElement and Uint8List blob download.


🎨 Customization #

Each widget accepts:

  • placeholder
  • errorWidget
  • scale, fit, backgroundColor, etc.

🍂 Constants & Styling #

AvatarStyleConstants.defaultRadius
AvatarStyleConstants.avatarPadding

🎓 Extensions #

'image.jpg'.isAssetPath // true if starts with 'assets/'

👁 Hero Support #

HeroWrapper(
  tag: 'profile_pic',
  child: AppImageViewer(...),
)

🚧 Dependencies #

dependency_overrides:
  cached_network_image: ^3.3.1
  photo_view: ^0.14.0
  image_gallery_saver: ^2.0.3
  permission_handler: ^11.3.0

📖 Example #

ImageWithTitle(
  title: 'Your Logo',
  logoPath: 'assets/icons/logo.jpg',
  isCircleAvatar: true,
)

📄 License #

MIT © 2025 reusable_image_widget authors


🚀 Contributing #

Pull requests and issues are welcome!


👨‍💼 Author #

reusable_image_widget Developed with ❤️ by Shohidul Islam Contributions, issues, and pull requests are welcome!


0
likes
0
points
105
downloads

Publisher

unverified uploader

Weekly Downloads

A reusable Flutter widget library for picking, cropping, compressing, and displaying images from gallery, camera, or network with full-screen preview support.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

app_style, cached_network_image, cross_file, file_saver, flutter, flutter_image_compress, http, image_gallery_saver, image_picker, loading_builder, online_indicator, permission_handler, photo_view

More

Packages that depend on reusable_image_widget