translateXY method

Widget translateXY(
  1. double x,
  2. double y, {
  3. bool fractional = false,
  4. Offset? from,
})

Applies a TranslateEffect to a Widget with the given x and y values. fractional determines whether the offset moves the Widget by using its own size as a percentage or by a fixed amount.

Implementation

Widget translateXY(
  double x,
  double y, {
  bool fractional = false,
  Offset? from,
}) {
  return EffectWidget(
    start: from == null
        ? null
        : TranslateEffect(
            offset: from,
            fractional: fractional,
          ),
    end: TranslateEffect(
      offset: Offset(x, y),
      fractional: fractional,
    ),
    child: this,
  );
}