findRoot<T> static method
Find the root data of the given type from the context. Throws an assertion error if the data is not found.
TThe type of the data.contextThe build context.
Implementation
static T findRoot<T>(BuildContext context) {
final data = maybeFindRoot<T>(context);
assert(data != null, 'No Data<$T> found in context');
return data!;
}