OctoImage class
OctoImage can be used as a replacement of Image. It can be used with any ImageProvider, but works best with CachedNetworkImageProvider. OctoImage can show a placeholder or progress and an error. It can also do transformations on the shown image. This all can be simplified by using a complete OctoSet with predefined combinations of OctoPlaceholderBuilder, OctoImageBuilder and OctoErrorBuilder.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OctoImage
Constructors
-
OctoImage({Key? key, required ImageProvider<
Object> image, OctoImageBuilder? imageBuilder, OctoPlaceholderBuilder? placeholderBuilder, OctoProgressIndicatorBuilder? progressIndicatorBuilder, OctoErrorBuilder? errorBuilder, Duration? fadeOutDuration, Curve? fadeOutCurve, Duration? fadeInDuration, Curve? fadeInCurve, double? width, double? height, BoxFit? fit, Alignment? alignment, ImageRepeat? repeat, bool? matchTextDirection, Color? color, FilterQuality? filterQuality, BlendMode? colorBlendMode, Duration? placeholderFadeInDuration, bool? gaplessPlayback, int? memCacheWidth, int? memCacheHeight}) -
Creates an OctoWidget that displays an image. The
image
is an ImageProvider and the OctoImage should work with any ImageProvider. The widget is optimized for CachedNetworkImageProvider or NetworkImage, as for those it makes sense to show download progress or an error widget. -
OctoImage.fromSet({Key? key, required ImageProvider<
Object> image, required OctoSet octoSet, Duration? fadeOutDuration, Curve? fadeOutCurve, Duration? fadeInDuration, Curve? fadeInCurve, double? width, double? height, BoxFit? fit, Alignment? alignment, ImageRepeat? repeat, bool? matchTextDirection, Color? color, FilterQuality? filterQuality, BlendMode? colorBlendMode, Duration? placeholderFadeInDuration, bool? gaplessPlayback, int? memCacheWidth, int? memCacheHeight}) -
Creates an OctoWidget that displays an image with a predefined OctoSet.
The
image
is an ImageProvider and the OctoImage should work with any ImageProvider. The widget is optimized for CachedNetworkImageProvider. or NetworkImage, as for those it makes sense to show download progress or an error widget.
Properties
- alignment → AlignmentGeometry
-
How to align the image within its bounds.
final
- color → Color?
-
If non-null, this color is blended with each image pixel using
colorBlendMode.
final
- colorBlendMode → BlendMode?
-
Used to combine color with this image.
final
- errorBuilder → OctoErrorBuilder?
-
Widget displayed while the target
imageUrl
failed loading.final - fadeInCurve → Curve
-
The curve of the fade-in animation for the
imageUrl
.final - fadeInDuration → Duration
-
The duration of the fade-in animation for the
imageUrl
.final - fadeOutCurve → Curve
-
The curve of the fade-out animation for the placeholderBuilder.
final
- fadeOutDuration → Duration
-
The duration of the fade-out animation for the placeholderBuilder.
final
- filterQuality → FilterQuality
-
Target the interpolation quality for image scaling.
final
- fit → BoxFit?
-
How to inscribe the image into the space allocated during layout.
final
- gaplessPlayback → bool
-
Whether to continue showing the old image (true), or briefly show the
placeholder (false), when the image provider changes.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
If non-null, require the image to have this height.
final
-
image
→ ImageProvider<
Object> -
The image that should be shown.
final
- imageBuilder → OctoImageBuilder?
-
Optional builder to further customize the display of the image.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- matchTextDirection → bool
-
Whether to paint the image in the direction of the TextDirection.
final
- placeholderBuilder → OctoPlaceholderBuilder?
-
Widget displayed while the target
imageUrl
is loading.final - placeholderFadeInDuration → Duration
-
The duration of the fade-in animation for the placeholderBuilder.
final
- progressIndicatorBuilder → OctoProgressIndicatorBuilder?
-
Widget displayed while the target
imageUrl
is loading.final - repeat → ImageRepeat
-
How to paint any portions of the layout bounds not covered by the image.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double?
-
If non-null, require the image to have this width.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _OctoImageState -
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