diff --git a/packages/flutter/lib/src/fn3/framework.dart b/packages/flutter/lib/src/fn3/framework.dart index caa2cbf4b8..d5b172c767 100644 --- a/packages/flutter/lib/src/fn3/framework.dart +++ b/packages/flutter/lib/src/fn3/framework.dart @@ -291,6 +291,9 @@ abstract class State { /// Pointer to the owner Element object StatefulComponentElement _element; + /// The context in which this object will be built + BuildContext get context => _element; + /// Called when this object is inserted into the tree. Override this function /// to perform initialization that depends on the location at which this /// object was inserted into the tree or on the widget configuration object. @@ -392,6 +395,7 @@ typedef void ElementVisitor(Element element); abstract class BuildContext { InheritedWidget inheritedWidgetOfType(Type targetType); + RenderObject findRenderObject(); } /// Elements are the instantiations of Widget configurations. @@ -601,6 +605,8 @@ abstract class Element implements BuildContext { return ancestor?.widget; } + RenderObject findRenderObject() => renderObject; + void dependenciesChanged() { assert(false); }