img library
Easily paint mirror-tiling images for seamless edge-to-edge textures from any source. |
---|
Defines Repeat, an expansion on ImageRepeat that enables mirroring,
as well as the Widgets, extensions, and methods to support it.
A Repeat
provides value over an ImageRepeat
as it defines three
additional tiling methods that invlove mirroring alternating tiles to
create a seamless edge-to-edge texture from a single image.
pub.dev Listing | API Doc | GitHub
API References: Repeat
| ImageToo
| ImageDecorationToo
| paintImageToo()
| InkImg
Provides the ImageToo stateless widget and several named constructors
for easily rendering images from a variety of sources.
Also available is the DecorationImageToo class for displaying an image as
a Decoration
instead of as a Widget
.
Shorthands: Img, DecorationImg
An InkImg will create an Ink.image-like decoration for a Material
that is capable of using the new Repeat modes and also renders
ink splashes over top of itself.
Finally, consider the String
to seamless texture methods in
StringToTexture. Also:
Along with ImageToo
, a new RawImageToo
and RenderImageToo
had
to be provided.
- These are the Dart-abstracting LeafRenderObjectWidget and RenderBox classes respectively.
DecorationImageToo
necessitated the DecorationImagePainterToo class.
These exist because RenderImageToo
and DecorationImagePainterToo
needed
to be forked from their vanilla Flutter counterparts in order to accommodate
a modified paintImage method called, predictably, paintImageToo that
handles the new Repeat values.
Classes
- DecorationImagePainterToo
- The painter for a DecorationImageToo.
- DecorationImageToo
- An image to show in a BoxDecoration which supports the Repeat rendering modes including Repeat.mirror.
- DecorationImg
- A shorthand wrapper for DecorationImageToo.
- ImageToo
- A StatefulWidget that renders an image according to a swath of optional properties. Several constructors are provided for painting an image from a variety of sources.
- Img
- A shorthand wrapper for ImageToo.
- InkImg
- A convenience widget for drawing images and other decorations on Material widgets, so that InkWell and InkResponse splashes will render over them.
Enums
- Repeat
- How to paint any portions of a box not covered by an image.
Extensions
- BytesToTexture on Uint8List
-
Provides toSeamlessTexture that considers
this Uin8List
as bytes that describe an image and returns an ImageToo widget. - FileToTexture on File
-
Provides toSeamlessTexture that considers
this File
as a file that leads to an image and returns an ImageToo widget. - StringToTexture on String
-
Provides toSeamlessTexture that considers
this String
as a URL that leads to an image and returns an ImageToo widget.
This is default behavior.
Functions
-
debugFlushLastFrameImageSizeInfo(
) → void - Flushes inter-frame tracking of image size information from paintImage.
-
paintImageToo(
{required Canvas canvas, required Rect rect, required Image image, String? debugImageLabel, double scale = 1.0, ColorFilter? colorFilter, BoxFit? fit, Alignment alignment = Alignment.center, Rect? centerSlice, Repeat repeat = Repeat.noRepeat, Offset mirrorOffset = Offset.zero, bool flipHorizontally = false, bool invertColors = false, FilterQuality filterQuality = FilterQuality.low, bool isAntiAlias = false}) → void - Paints an image into the given rectangle on the canvas.