@@ -87,6 +87,7 @@ class InteractiveViewer extends StatefulWidget {
87
87
this .scaleEnabled = true ,
88
88
this .scaleFactor = 200.0 ,
89
89
this .transformationController,
90
+ this .alignment,
90
91
required Widget this .child,
91
92
}) : assert (alignPanAxis != null ),
92
93
assert (panAxis != null ),
@@ -141,6 +142,7 @@ class InteractiveViewer extends StatefulWidget {
141
142
this .scaleEnabled = true ,
142
143
this .scaleFactor = 200.0 ,
143
144
this .transformationController,
145
+ this .alignment,
144
146
required InteractiveViewerWidgetBuilder this .builder,
145
147
}) : assert (panAxis != null ),
146
148
assert (builder != null ),
@@ -166,6 +168,9 @@ class InteractiveViewer extends StatefulWidget {
166
168
constrained = false ,
167
169
child = null ;
168
170
171
+ /// The alignment of the child's origin, relative to the size of the box.
172
+ final Alignment ? alignment;
173
+
169
174
/// If set to [Clip.none] , the child may extend beyond the size of the InteractiveViewer,
170
175
/// but it will not receive gestures in these areas.
171
176
/// Be sure that the InteractiveViewer is the desired size when using [Clip.none] .
@@ -1096,6 +1101,7 @@ class _InteractiveViewerState extends State<InteractiveViewer> with TickerProvid
1096
1101
clipBehavior: widget.clipBehavior,
1097
1102
constrained: widget.constrained,
1098
1103
matrix: _transformationController! .value,
1104
+ alignment: widget.alignment,
1099
1105
child: widget.child! ,
1100
1106
);
1101
1107
} else {
@@ -1110,6 +1116,7 @@ class _InteractiveViewerState extends State<InteractiveViewer> with TickerProvid
1110
1116
childKey: _childKey,
1111
1117
clipBehavior: widget.clipBehavior,
1112
1118
constrained: widget.constrained,
1119
+ alignment: widget.alignment,
1113
1120
matrix: matrix,
1114
1121
child: widget.builder !(
1115
1122
context,
@@ -1143,18 +1150,21 @@ class _InteractiveViewerBuilt extends StatelessWidget {
1143
1150
required this .clipBehavior,
1144
1151
required this .constrained,
1145
1152
required this .matrix,
1153
+ required this .alignment,
1146
1154
});
1147
1155
1148
1156
final Widget child;
1149
1157
final GlobalKey childKey;
1150
1158
final Clip clipBehavior;
1151
1159
final bool constrained;
1152
1160
final Matrix4 matrix;
1161
+ final Alignment ? alignment;
1153
1162
1154
1163
@override
1155
1164
Widget build (BuildContext context) {
1156
1165
Widget child = Transform (
1157
1166
transform: matrix,
1167
+ alignment: alignment,
1158
1168
child: KeyedSubtree (
1159
1169
key: childKey,
1160
1170
child: this .child,
0 commit comments