GSImage class

A widget that displays an image with customizable styling options including size, border radius, and more. GSImage supports both network and asset images, making it versatile for various use cases.

Inheritance

Constructors

GSImage.new({Key? key, required String path, required GSImageType imageType, GSStyle? style, GSImageRadius? borderRadius = GSImageRadius.$none, int? cacheHeight, int? cacheWidth, Rect? centerSlice, Color? color, BlendMode? colorBlendMode, Widget errorBuilder(BuildContext, Object, StackTrace?)?, BoxFit? fit, GSImageSizes? size, Widget frameBuilder(BuildContext, Widget, int?, bool)?, Map<String, String>? headers, Widget loadingBuilder(BuildContext, Widget, ImageChunkEvent?)?, Animation<double>? opacity, String? semanticLabel, ImageRepeat repeat = ImageRepeat.noRepeat, bool matchTextDirection = false, FilterQuality filterQuality = FilterQuality.low, AlignmentGeometry alignment = Alignment.center, bool excludeFromSemantics = false, bool gaplessPlayback = false, bool isAntiAlias = false, double scale = 1.0})
const

Properties

alignment AlignmentGeometry
The alignment of the image within its container.
final
borderRadius GSImageRadius?
The border radius category of the image, influencing the roundness of its corners.
final
cacheHeight int?
Optional height to cache the image at for improved performance.
final
cacheWidth int?
Optional width to cache the image at for improved performance.
final
centerSlice Rect?
An optional slice of the image to stretch when scaling.
final
color Color?
Optional color to apply to the image with an optional blend mode.
final
colorBlendMode BlendMode?
final
errorBuilder Widget Function(BuildContext, Object, StackTrace?)?
A builder function for customizing the display of errors.
final
excludeFromSemantics bool
Whether to exclude the image from the semantics tree.
final
filterQuality FilterQuality
The quality of filtering to use when scaling the image.
final
fit BoxFit?
How the image should fit within its allocated space.
final
frameBuilder Widget Function(BuildContext, Widget, int?, bool)?
A builder function for customizing the display of image frames.
final
gaplessPlayback bool
Whether the new image should replace the old image without changing the key.
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
Optional headers for network image requests.
final
imageType GSImageType
The type of image, specifying whether it's a network or asset image.
final
isAntiAlias bool
Whether to apply anti-aliasing to the image.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingBuilder Widget Function(BuildContext, Widget, ImageChunkEvent?)?
A builder function for customizing the display while the image is loading.
final
matchTextDirection bool
Whether the image should match the text direction.
final
opacity Animation<double>?
An animation for the image opacity.
final
path String
The path or URL of the image to be displayed.
final
repeat ImageRepeat
How the image should be repeated within its bounds.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
The scale factor to apply to the image.
final
semanticLabel String?
Optional semantic label for the image.
final
size GSImageSizes?
The size category of the image, influencing its dimensions.
final
style GSStyle?
Custom GSConfigStyle to apply to the image, allowing for further customization.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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, int wrapWidth = 65}) 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