Make the widgets binding reusable. (#3479)
Previously the widgets layer only provided a concrete binding, which makes it awkward to extend it compared to other bindings. This moves widgets to the same style as the other layers. In a subsequent patch I'll use this to make the tests layer saner.
This commit is contained in:
@@ -89,7 +89,7 @@ void rotate(Duration timeStamp) {
|
||||
}
|
||||
|
||||
void main() {
|
||||
WidgetFlutterBinding.ensureInitialized();
|
||||
Widgeteer binding = WidgetFlutterBinding.ensureInitialized();
|
||||
RenderProxyBox proxy = new RenderProxyBox();
|
||||
attachWidgetTreeToRenderTree(proxy);
|
||||
|
||||
@@ -101,6 +101,6 @@ void main() {
|
||||
transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity());
|
||||
RenderPadding root = new RenderPadding(padding: new EdgeInsets.all(80.0), child: transformBox);
|
||||
|
||||
WidgetFlutterBinding.instance.renderView.child = root;
|
||||
WidgetFlutterBinding.instance.addPersistentFrameCallback(rotate);
|
||||
binding.renderView.child = root;
|
||||
binding.addPersistentFrameCallback(rotate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user