Merge pull request #1653 from evoL/evol/push-qlpuxltsltwt
fix: never use a transition on the shell route
This commit is contained in:
commit
9e7d939c2f
1 changed files with 16 additions and 6 deletions
|
|
@ -87,7 +87,10 @@ abstract class AppRoutes {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ShellRoute(
|
ShellRoute(
|
||||||
pageBuilder: (context, state, child) => defaultPageBuilder(
|
// Never use a transition on the shell route. Changing the PageBuilder
|
||||||
|
// here based on a MediaQuery causes the child to briefly be rendered
|
||||||
|
// twice with the same GlobalKey, blowing up the rendering.
|
||||||
|
pageBuilder: (context, state, child) => noTransitionPageBuilder(
|
||||||
context,
|
context,
|
||||||
state,
|
state,
|
||||||
FluffyThemes.isColumnMode(context) &&
|
FluffyThemes.isColumnMode(context) &&
|
||||||
|
|
@ -458,17 +461,24 @@ abstract class AppRoutes {
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
static Page noTransitionPageBuilder(
|
||||||
|
BuildContext context,
|
||||||
|
GoRouterState state,
|
||||||
|
Widget child,
|
||||||
|
) =>
|
||||||
|
NoTransitionPage(
|
||||||
|
key: state.pageKey,
|
||||||
|
restorationId: state.pageKey.value,
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
|
||||||
static Page defaultPageBuilder(
|
static Page defaultPageBuilder(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
GoRouterState state,
|
GoRouterState state,
|
||||||
Widget child,
|
Widget child,
|
||||||
) =>
|
) =>
|
||||||
FluffyThemes.isColumnMode(context)
|
FluffyThemes.isColumnMode(context)
|
||||||
? NoTransitionPage(
|
? noTransitionPageBuilder(context, state, child)
|
||||||
key: state.pageKey,
|
|
||||||
restorationId: state.pageKey.value,
|
|
||||||
child: child,
|
|
||||||
)
|
|
||||||
: MaterialPage(
|
: MaterialPage(
|
||||||
key: state.pageKey,
|
key: state.pageKey,
|
||||||
restorationId: state.pageKey.value,
|
restorationId: state.pageKey.value,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue