SSpreadsheetZoomViewport class

Renders child inside a logical viewport of incoming size / zoom and paints it at zoom.

This is the primitive SSpreadsheet.zoom is built from, exposed so that any layer sharing the sheet's coordinate space — an overlay positioned from the same row/column dimensions, a HUD pinned to the grid — can be scaled by exactly the same amount and stay aligned with the sheet.

Scaling down enlarges the logical viewport rather than shrinking the content into a corner, so zooming out reveals more rows and columns instead of leaving empty space around a smaller copy of the sheet; scaling up shrinks the logical viewport, so fewer of them fit — which is what zooming in means for a scrollable grid.

Two cases pass child through unwrapped, so they cost nothing and cannot regress an existing layout:

  • zoom == 1.0, the default everywhere;
  • unbounded incoming constraints, where there is no viewport to divide — the child is then laid out as it would have been, rather than unbounded or with a meaningless logical size.
Inheritance
Available extensions

Constructors

SSpreadsheetZoomViewport({Key? key, required double zoom, AlignmentGeometry alignment = Alignment.topLeft, required Widget child})
const

Properties

alignment → AlignmentGeometry
Alignment for both the resized logical box and the Transform.scale that paints it. Top-left keeps the sheet's origin — its row-header corner — pinned, so the scroll offsets the sheet already tracks stay meaningful.
final
child → Widget
The content to lay out at size / zoom and paint at zoom.
final
hashCode → int
The hash code for this object.
no setterinherited
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
zoom → double
Scale factor applied to child. Must be greater than zero; 1.0 leaves the child untouched.
final

Methods

addMaterialWidget() → Material

Available on Widget, provided by the GenericExtensions extension

addTooltipWidget(String toolTip) → Tooltip

Available on Widget, provided by the GenericExtensions extension

borderRadius([BorderRadiusGeometry? borderRadius]) → Widget

Available on Widget, provided by the GenericExtensions extension

boxDecoration([BoxDecoration? boxDecoration]) → Widget

Available on Widget, provided by the GenericExtensions extension

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
colorFilter([ColorFilter? colorFilter]) → Widget

Available on Widget, provided by the GenericExtensions extension

set parent widget in center
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