getOneRequired<T> method

  1. @override
T getOneRequired<T>(
  1. dynamic locator
)
override

Gets a required component reference that matches specified locator.

  • locator the locator to find a reference by. Returns a matching component reference. Throws a ReferenceException when no references found.

Implementation

@override
T getOneRequired<T>(locator) {
  var components = find<T>(locator, true);
  if (components.isEmpty) throw ReferenceException(null, locator);
  return components[0];
}