translateX method

Widget translateX(
  1. double x, {
  2. bool fractional = false,
  3. double? from,
})

Applies a TranslateEffect to a Widget only on the x-axis. fractional determines whether the offset moves the Widget by using its own size as a percentage or by a fixed amount.

Implementation

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