build method Null safety

  1. @override
Widget build(
  1. BuildContext context

Override this method to build widgets that depend on the state of the listenable (e.g., the current value of the animation).


Widget build(BuildContext context) {
  Offset offset = position.value;
  if (textDirection == TextDirection.rtl) {
    offset = Offset(-offset.dx, offset.dy);
  return FractionalTranslation(
    translation: offset,
    transformHitTests: transformHitTests,
    child: child,