Skip to content

Commit bda8d82

Browse files
committed
Simplify getChildOrNull implementation
1 parent e7aed98 commit bda8d82

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

boxy/lib/src/boxy/custom_boxy_base.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -989,10 +989,7 @@ abstract class BaseBoxyDelegate<LayoutData extends Object,
989989
/// Gets the child handle with the specified [id] or returns null if there
990990
/// is no child with given [id].
991991
T? getChildOrNull<T extends ChildHandleType>(Object id) {
992-
if (hasChild(id)) {
993-
return getChild(id);
994-
}
995-
return null;
992+
return render.childHandleMap[id] as T?;
996993
}
997994

998995
/// Gets the [BuildContext] of this boxy.

0 commit comments

Comments
 (0)