ScaleView class

Scale the child from minScale to maxScale.

ScaleView not only support scale and double click gesture, but also support move widget in horizontal and vertical direction when its child widget is scaled.

The child scale range is minScale< scale < maxScale. the size will be scale*widgetSize

When the child widget is scaled and the content is overflow, you can use ClipRect to clip the content to equal the room of ScaleView

  ClipRect(
   child: ScaleView(
      child: Image.asset("imgs/xx.png"),
      minScale: .5,
      maxScale: 3,
    )
 )

Gesture conflicts may occur when the scale view in a Scrollable widget such as ListView, in this scenario, you can specify the parentScrollableAxis explicitly.

Inheritance

Constructors

ScaleView({Key? key, double minScale = 1.0, double maxScale = 10.0, double doubleClickScale = 3.0, Alignment alignment = Alignment.center, Axis? parentScrollableAxis = Axis.horizontal, required Widget child})
const

Properties

alignment Alignment
Child widget alignment in scale view.
final
child Widget
final
doubleClickScale double
Determine how many times to scale after double click.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxScale double
Maximum scale multiplier
final
minScale double
Minimum scale multiplier
final
parentScrollableAxis Axis?
If there is an ancestor scrollview, in order to resolve the gesture conflict between ScaleView and the ancestor scrollview , parentScrollableAxis must be same as the scroll direction of the ancestor scrollview.
final
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() → _ScaleViewState
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