ImageWidget class
A full-screen widget to display an image with options for zooming, downloading, and sharing.
This widget takes a list containing a single image URL or asset path
and displays it in a CustomScaffold. It uses PinchZoom to allow
the user to zoom in and out of the image.
It also provides optional app bar actions for downloading and sharing the image.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- ImageWidget
Constructors
- ImageWidget({Key? key, required List image, Color? color, CustomFileType fileType = CustomFileType.asset, double borderRadius = 12.0, bool isBoxShadow = true, bool isDownloadIcon = false, dynamic onTap()?, double? width = 30})
- Creates an ImageWidget.
Properties
- borderRadius → double
-
The border radius for the container, although the image is displayed full-screen.
final
- color → Color?
-
The background color of the container. Defaults to transparent.
final
- fileType → CustomFileType
-
The type of file source, either
assetornetwork.final - hashCode → int
-
The hash code for this object.
no setterinherited
- image → List
-
A list containing the image URL or asset path. Currently, it only supports one image.
final
- isBoxShadow → bool
-
Whether to show a box shadow behind the image container.
final
-
isDownload
→ ValueNotifier<
bool> -
A
ValueNotifierto track the download state of the image. It is used to show a loader while the image is being downloaded or prepared for sharing.final - isDownloadIcon → bool
-
Whether to display a download icon in the app bar.
final
-
Whether to display a share icon in the app bar.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onTap → dynamic Function()?
-
An optional callback function to be executed when the image is tapped.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double?
-
The width of the image. This parameter is currently not used in the layout.
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