ImagePixels class
The ImagePixels widget lets you define an image through an imageProvider, and then use a builder to build a child widget that depends on the image dimension and the color of its pixels.
The default constructor lets you provide the imageProvider, the builder, and a defaultColor to be used when reading pixels outside of the image (or while the image is downloading).
The ImagePixels.container constructor creates a container with a background-color
that is the same color as the image pixel at the colorAlignment
position.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ImagePixels
Constructors
-
ImagePixels({required ImageProvider<
Object> ? imageProvider, Color defaultColor = Colors.grey, required BuilderFromImage builder}) -
Lets you provide the imageProvider, the builder, as well as a
defaultColor to be used when reading pixels outside the image (or
while the image is downloading). If imageProvider is null, the
image will be empty and it will all be painted with the defaultColor.
const
-
ImagePixels.container({required ImageProvider<
Object> ? imageProvider, Color defaultColor = Colors.grey, Alignment colorAlignment = Alignment.topLeft, Widget? child}) -
Returns a container with the given
child
. The background color of the container is given by the pixel in thecolorAlignment
position of the image pointed by the imageProvider. The defaultColor will be used for pixels outside the image (or while the image is downloading). If imageProvider is null, the image will be empty and it will all be painted with the defaultColor.
Properties
- builder → BuilderFromImage
-
final
- defaultColor → Color
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
imageProvider
→ ImageProvider<
Object> ? -
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _ImagePixelsState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited