findRoot<T> method

T findRoot<T>()

Find the root data of the given type from the context. Throws an assertion error if the data is not found.

  • T The type of the data.
  • context The build context.

Implementation

T findRoot<T>() {
  assert(state.mounted, 'State is not mounted');
  return Data.findRoot<T>(state.context);
}