Provide the BuildContext to createRenderObject and updateRenderObject

We'll need this for RTL support because the RTL state will live in the widget
tree. Also, remove the `oldWidget` argument to updateRenderObject because there
aren't any clients for it.
This commit is contained in:
Adam Barth
2016-03-11 08:59:37 -08:00
parent 183fd2051d
commit 0277b075e0
21 changed files with 115 additions and 118 deletions

View File

@@ -24,9 +24,9 @@ class SpriteWidget extends OneChildRenderObjectWidget {
/// var mySpriteWidget = new SpriteWidget(mySpriteTree, SpriteBoxTransformMode.fixedHeight);
SpriteWidget(this.rootNode, [this.transformMode = SpriteBoxTransformMode.letterbox]);
SpriteBox createRenderObject() => new SpriteBox(rootNode, transformMode);
SpriteBox createRenderObject(BuildContext context) => new SpriteBox(rootNode, transformMode);
void updateRenderObject(SpriteBox renderObject, SpriteWidget oldWidget) {
void updateRenderObject(BuildContext context, SpriteBox renderObject) {
renderObject
..rootNode = rootNode
..transformMode = transformMode;