> For the complete documentation index, see [llms.txt](https://ye-lwin-oo-1.gitbook.io/pulse-x-state-management/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ye-lwin-oo-1.gitbook.io/pulse-x-state-management/route-management/routing.md).

# Routing

{% hint style="info" %}
Are you frustrated about using **BuildContext** everytime when you navigate? Here comes the solution.&#x20;
{% endhint %}

**Pulse-X's** navigation service relies on **BuildContext** but you won't have to use context everytime when you navigates to a screen or pops back to the original screen.

🚧 Pulse-X's navigator is still under implementation stage and only three functions have been implemented.

* push
* pushNamed
* pop

But, first you'll have to do a few things in order to get contextless navigation.

#### Step 1:

Register Pulse-X's navigator key in your `MaterialApp` like this.

```dart
// ...your code...
MaterialApp(
    // other stuff
    navigatorKey: PulseXNavigator.navigatorKey,// register pulse's navigator key
);
// ...your code...
```

#### Step 2:

Register Pulse-X's navigation service in your dependency injection section like this.

```dart
PulseXInjector injector = PulseXInjector.instance;
injector.registerLazySingleton(() => PulseXNavigator());
```

#### Final Step:&#x20;

Now, you can use Pulse-X's navigation service easily.&#x20;

```dart
final _navigator = injector.find<PulseXNavigator>();
```

You can `await` return values from another screen.

```dart
final data = await _navigator.push(AnotherView());
              if(data != null){
                // do something
              }
```

For push method,

```dart
_navigator.push(AnotherView();
```

For pushNamed method,

🚧 still coding and testing, I'll let you know when it's ready

For pop method,

```dart
 _navigator.pop();
```

You can return arguments from pop method like this.

```dart
 _navigator.pop<String>("return value");
```
