> ## Documentation Index
> Fetch the complete documentation index at: https://starrycodes.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# BuildContext - Navigation Extensions

> Master routing with one-line push and pop methods, eliminating verbose MaterialPageRoute calls and making your routing declarative.

{/*     title="⚡ Quick Usage" */}

{/* > */}

{/* // Launching */}

{/* // Named Routes */}

{/* // Returning */}

{/* context.popUntilRoot(); */}

{/* </Card> */}

<Steps titleSize="h3">
  <Step title="🚀 Pushes & Launches">
    <ResponseField name="push(Widget page)" type="Future<T?>">
      The preferred way to navigate. Pushes a new page and returns a Future that completes on pop.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      await context.push(const ProfileScreen());
      ```
    </ResponseField>

    <ResponseField name="pushReplacement<T, TO>(Widget page)" type="Future<T?>">
      Replaces the current route with a new page. Ideal for post-login or checkout success screens.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      context.pushReplacement(const HomeScreen());
      ```
    </ResponseField>

    <ResponseField name="pushNamed<T>(String routeName, {Object? arguments})" type="Future<T?>">
      Pushes a route defined by its string name onto the stack.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      context.pushNamed('/settings', arguments: {'id': 123});
      ```
    </ResponseField>
  </Step>

  <Step title="↩️ Pops & Returns">
    <ResponseField name="pop()" type="void">
      Pops the current route off the stack. (Aliased to `popScreen` for consistency).

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      IconButton(onPressed: context.pop, icon: Icon(Icons.close));
      ```
    </ResponseField>

    <ResponseField name="popScreen()" type="void">
      Pops the current route off the navigator stack (wrapper for `Navigator.pop`).

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      context.popScreen();
      ```
    </ResponseField>

    <ResponseField name="popUntilRoot()" type="void">
      Pops all routes until the very first (root) screen is reached. Great for clearing the stack after a successful flow.

      ```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      context.popUntilRoot();
      ```
    </ResponseField>
  </Step>
</Steps>
