offset method
Offsets this widget by x
and y
or an offset
.
Implementation
@widgetFactory
Widget offset({
double? x,
double? y,
Offset? offset,
bool transformHitTests = true,
FilterQuality? filterQuality,
bool fractional = false,
}) {
assert(
!fractional || filterQuality == null,
'offset cannot be fractional and specify filterQuality.',
);
assert(() {
_debugCheckParameterCombinations(modifier: 'offset', [
{'x': x, 'y': y},
{'offset': offset},
]);
return true;
}());
offset ??= Offset(x ?? 0, y ?? 0);
if (fractional) {
return FleetFractionalTranslation(
translation: offset,
transformHitTests: transformHitTests,
child: this,
);
} else {
return FleetTransform.translate(
offset: offset,
transformHitTests: transformHitTests,
filterQuality: filterQuality,
child: this,
);
}
}