navigateFragment method

Future<void> navigateFragment(
  1. String fragment
)

Navigates to fragment on the current pathname by pushing a new history entry.

Retains the current pathname and query string while setting or updating the hash fragment.

await controller.navigateFragment('section-2');

Implementation

Future<void> navigateFragment(String fragment) async {
  await setFragment(fragment, replace: false);
}