getSyncOrNone<T extends Object> method
Retrieves a synchronous dependency or None if not found or async.
Single exhaustive pattern collapses the Option × Resolvable × Result
state space — every "not found / not sync / not ok" branch falls into
the wildcard, so we can't accidentally return a partial value.
Implementation
Option<T> getSyncOrNone<T extends Object>({
Entity groupEntity = const DefaultEntity(),
bool traverse = true,
}) {
assert(T != Object, 'T must be specified and cannot be Object.');
return switch (get<T>(groupEntity: groupEntity, traverse: traverse)) {
Some(value: Sync(value: Ok(value: final v))) => Some(v),
_ => const None(),
};
}