resizeSecondary method
- BuildContext context, {
- ScaleModeY? y,
- ScaleModeX? x,
- double? dx,
- double? dy,
Resizes the secondary view along x
by dx
and/or y
by dy
axis.
Implementation
void resizeSecondary(
BuildContext context, {
ScaleModeY? y,
ScaleModeX? x,
double? dx,
double? dy,
}) {
if (x != null && dx != null) {
final RxnDouble xPrimaryOffset =
x == ScaleModeX.left ? secondaryLeft : secondaryRight;
final RxnDouble xSecondaryOffset =
x == ScaleModeX.left ? secondaryRight : secondaryLeft;
_updateSecondaryAxisOffset(
primary: xPrimaryOffset,
secondary: xSecondaryOffset,
axis: Axis.horizontal,
);
_updateSecondarySize(
sideOffset: xPrimaryOffset,
applyOffset: x == ScaleModeX.left ? _applySLeft : _applySRight,
delta: dx,
axis: Axis.horizontal,
);
}
if (y != null && dy != null) {
final RxnDouble yPrimaryOffset =
y == ScaleModeY.top ? secondaryTop : secondaryBottom;
final RxnDouble ySecondaryOffset =
y == ScaleModeY.top ? secondaryBottom : secondaryTop;
_updateSecondaryAxisOffset(
primary: yPrimaryOffset,
secondary: ySecondaryOffset,
axis: Axis.vertical,
);
_updateSecondarySize(
sideOffset: yPrimaryOffset,
applyOffset: y == ScaleModeY.top ? _applySTop : _applySBottom,
delta: dy,
axis: Axis.vertical,
);
}
applySecondaryConstraints();
}