In the Flutter go_router
package, there are apparently two ways of creating a new page, with either a builder
or a pageBuilder
:
GoRoute(
name: 'Route',
path: '/route',
builder: (BuildContext context, GoRouterState state) =>
const RouteView(...),
pageBuilder: (BuildContext context, GoRouterState state) =>
MaterialPage(
child: const RouteView(...),
),
),
But what is the difference between them? They seem to do the same thing, only pageBuilder
has a wrapper of MaterialPage
on it, is that all? By the way, is a MaterialPage
that useful?