getOneOptional<T> method
Gets an optional component reference that matches specified locator.
locator
the locator to find references by. Returns a matching component reference or null if nothing was found.
Implementation
@override
T? getOneOptional<T>(locator) {
try {
var components = find<T>(locator, false);
return components.isNotEmpty ? components[0] : null;
} catch (ex) {
return null;
}
}