pushDetails<T extends Object?> static method

Future<T?> pushDetails<T extends Object?>(
  1. BuildContext context,
  2. Route<T> route, {
  3. bool rootNavigator = false,
})

Pushes a details route, either onto the split navigator if available or onto the regular navigator.

context is the BuildContext of the current widget tree. route is the route to be pushed. rootNavigator is an optional flag to force using the root navigator.

Implementation

static Future<T?> pushDetails<T extends Object?>(
  BuildContext context,
  Route<T> route, {
  bool rootNavigator = false,
}) {
  return _handleNavigation(
    context: context,
    rootNavigator: rootNavigator,
    regularNavigatorAction: (NavigatorState state) {
      return state.push(route);
    },
    splitNavigatorAction: (NavigatorState state) {
      return state.pushAndRemoveUntil(
          route, ModalRoute.withName(ZdsSplitNavigator.emptyRoute),);
    },
  );
}