useArg function

dynamic useArg()

Get a map of the page from Hooks.

It is only available within the build method.

Basically it returns the RouteQuery data passed from the previous page.

If the RouteQuery data is not found, the map stored in PageHookWidget is retrieved.

Implementation

DynamicMap useArg() {
  final context = useContext();
  return ModalRoute.of(context)?.settings.arguments as DynamicMap? ??
      UIScope.of(context)._map;
}