1. override
Widget buildPage(BuildContext context, Animation<double> animation, Animation<double> forwardAnimation)

Override this method to build the primary content of this route.

  • context The context in which the route is being built.
  • animation The animation for this route's transition. When entering, the animation runs forward from 0.0 to 1.0. When exiting, this animation runs backwards from 1.0 to 0.0.
  • forwardAnimation The animation for the route being pushed on top of this route. This animation lets this route coordinate with the entrance and exit transition of routes pushed on top of this route.

Source

@override
Widget buildPage(BuildContext context, Animation<double> animation, Animation<double> forwardAnimation) {
  Widget result = builder(context);
  assert(() {
    if (result == null) {
      throw new FlutterError(
        'The builder for route "${settings.name}" returned null.\n'
        'Route builders must never return null.'
      );
    }
    return true;
  });
  return result;
}