transition method

Widget transition(
  1. Widget? prevScreenBodyCapture,
  2. Widget currentScreenBody
)

Override to define how to transition from prevScreenBody to currentScreenBody.

Example 1:

// Render the previous screen capture underneath the current screen.
@override
Widget bodyTransition(Widget? prevScreenBodyCapture, Widget currentScreenBody) {
 return Stack(
   children: [
     if (prevScreenBodyCapture != null) prevScreenBodyCapture,
     currentScreenBody,
   ],
 );
}

Example 2:

// Fade from the previous screen capture into the current screen.
@override
Widget bodyTransition(Widget? prevScreenBodyCapture, Widget currentScreenBody) {
  return WAnimatedFade(
    layer1: prevScreenBodyCapture,
    layer2: currentScreenBody,
  );
}

Implementation

Widget transition(Widget? prevScreenBodyCapture, Widget currentScreenBody) {
  return Stack(
    children: [
      if (prevScreenBodyCapture != null) prevScreenBodyCapture,
      currentScreenBody,
    ],
  );
}