flutter loading gifs
flutter loading gifs <
material and cupertino (android and ios) loading indicators in assorted sizes. use as placeholders for loading remote image assets.
usage
import this library into your project:
loading_gifs: ^latest_version
use cupertinoactivityindicator
or circularprogressindicator
where ever a loading image is needed.
fadeinimage.assetnetwork(placeholder: cupertinoactivityindicator, image: "image.png");
that’s it!
usage tips
size
this library is optimized for size so it only includes the base asset sizes. change the size of the loading spinners using scale
and placeholderscale
.
fadeinimage.assetnetwork(placeholder: cupertinoactivityindicator, image: "image.png", placeholderscale: 5);
image.asset(circularprogressindicator, scale: 10);
dynamic images
when loading images whose dimensions are unknown ahead of time, use cupertinoactivityindicatorsmall
instead of cupertinoactivityindicator
. cupertinoactivityindicatorsmall
is a min height variant of cupertinoactivityindicator
which allows flutter to correctly expand the loaded image into the layout.
the small variant should be used when loading a list of images or compositing an image from multiple images.
listview(
children: <widget>[
fadeinimage.assetnetwork(
placeholder: cupertinoactivityindicatorsmall,
image: "image_1.png"),
fadeinimage.assetnetwork(
placeholder: cupertinoactivityindicatorsmall,
image: "image_2.png"),
fadeinimage.assetnetwork(
placeholder: cupertinoactivityindicatorsmall,
image: "image_3.png"),
],
)
assets
ios (cupertino) loading indicators
full (159kb) | optimized (78kb) |
large square (36kb) | medium square (14kb) | small square (7kb) |
large (16kb) | medium (16kb) | small (16kb) |
android (material) loading indicators
full (1.13mb) | optimized (263kb) |
large square (225kb) | medium square (148kb) | small square (100kb) |
large (129kb) | medium (149kb) | small (186kb) |
Comments are closed.