ImageSizeGetter class
The main class of ImageSizeGetter.
Simple example:
import 'dart:io';
import 'package:image_size_getter/image_size_getter.dart';
import 'package:image_size_getter/file_input.dart'; // For compatibility with flutter web.
void main(List<String> arguments) async {
final file = File('asset/IMG_20180908_080245.jpg');
final size = ImageSizeGetter.getSize(FileInput(file));
print('jpg size: $size');
}
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getSize(
ImageInput input) → Size -
Get the size of the
input
. -
getSizeAsync(
AsyncImageInput input) → Future< Size> -
Get the size of the
input
. -
isGif(
ImageInput input) → bool -
Returns the
input
is gif format or not. -
isJpg(
ImageInput input) → bool -
Returns the
input
is jpeg format or not. -
isPng(
ImageInput input) → bool -
Returns the
input
is png format or not. -
isWebp(
ImageInput input) → bool -
Returns the
input
is webp format or not. -
registerDecoder(
BaseDecoder decoder) → void - Registers a BaseDecoder to the container.