createPO<T> function

T createPO<T>(
  1. PageLoaderElement source,
  2. POFactory<T> poFactory, {
  3. Finder? finder,
})

Generates PO of type T using source as context. If finder is provided, creates a new PO using context plus finder.

Example: final myPO = createPO

Implementation

T createPO<T>(PageLoaderElement source, POFactory<T> poFactory,
    {Finder? finder}) {
  final element =
      finder == null ? source : source.createElement(finder, [], []);
  return poFactory(element);
}