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:
Ian Hickson
2016-04-21 16:06:51 -07:00
parent cf56caa708
commit 0e11b0e6e3
13 changed files with 167 additions and 76 deletions

View File

@@ -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);
}