linearTranslateWithLargestRectSizeTween function

RectTween linearTranslateWithLargestRectSizeTween(
  1. Rect? begin,
  2. Rect? end
)

Navigation bars' hero rect tween that will move between the static bars but keep a constant size that's the bigger of both navigation bars.

Implementation

RectTween linearTranslateWithLargestRectSizeTween(Rect? begin, Rect? end) {
  final Size largestSize = Size(
    max(begin!.size.width, end!.size.width),
    max(begin.size.height, end.size.height),
  );
  return RectTween(
    begin: begin.topLeft & largestSize,
    end: end.topLeft & largestSize,
  );
}