Last updated:
0 purchases
nex image
NexImage #
NexImage is a Flutter widget that simplifies image rendering and animation support across various formats, both from assets and network sources. This library provides automatic asset image detection, supports Lottie animations, handles network images efficiently, and can even convert PDFs to images. It aims to streamline the process of displaying multiple image formats in Flutter applications.
Features #
Automatic Asset Image Detection: Easily detects and renders different image formats directly from the asset files.
Lottie Animation Support: Displays Lottie animations from both asset files and network URLs.
Network Image Support: Efficiently loads network images using CachedNetworkImage for optimized caching and performance.
PDF to Image Conversion: Converts the first page of a PDF into an image for quick display.
Multiple Image Extension Support: Handles various image formats including SVG, PNG, BMP, GIF, WEBP, TIFF, HEIC, and more.
Screenshots #
Installation #
Add nex_image to your pubspec.yaml file:
dependencies:
nex_image: ^1.0.0
copied to clipboard
Then, run:
flutter pub get
copied to clipboard
Usage #
Here's how to use the NexImage widget to display different types of images:
Displaying Asset Images #
import 'package:nex_image/nex_image.dart';
Column(
children: [
Text('PNG Image'),
NexImage.asset(
imagePath: 'assets/images/sample.png',
),
],
);
copied to clipboard
Displaying Network Images #
import 'package:nex_image/nex_image.dart';
Column(
children: [
Text('Network Image'),
NexImage.network(
imageUrl: 'https://example.com/sample.jpg',
),
],
);
copied to clipboard
Displaying Lottie Animations #
From Assets
import 'package:nex_image/nex_image.dart';
Column(
children: [
Text('Lottie Animation from Assets'),
NexImage.lottie(
imagePath: 'assets/animations/sample.json',
repeat: true,
),
],
);
copied to clipboard
From Network
import 'package:nex_image/nex_image.dart';
Column(
children: [
Text('Lottie Animation from Network'),
NexImage.lottie(
imagePath: 'https://example.com/animation.json',
repeat: true,
),
],
);
copied to clipboard
Displaying PDF as Image #
import 'package:nex_image/nex_image.dart';
Column(
children: [
Text('PDF as Image'),
NexImage.asset(
imagePath: 'assets/pdfs/sample.pdf',
),
],
);
copied to clipboard
Supported Image Formats #
SVG: Scalable Vector Graphics
PNG: Portable Network Graphics
BMP: Bitmap Image File
GIF: Graphics Interchange Format (supports animation)
WEBP: WebP image format
TIFF: Tagged Image File Format
HEIC: High-Efficiency Image Coding
PDF: Displays the first page of the PDF as an image
Network Images: Any standard image format from a URL
Lottie Animations: JSON-based animations
Contribution #
Contributions are welcome! Please feel free to submit issues or pull requests.
License #
This project is licensed under the MIT License. See the LICENSE file for details.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.