Use a member function instead of an anonymous closure

It's slightly more efficient.
This commit is contained in:
Adam Barth 2016-03-10 16:31:43 -08:00
parent fd8695b64a
commit 7f5d6a9913

View File

@ -1377,9 +1377,11 @@ class StatefulComponentElement<T extends StatefulComponent, U extends State<T>>
abstract class _ProxyElement<T extends _ProxyComponent> extends ComponentElement<T> {
_ProxyElement(T widget) : super(widget) {
_builder = (BuildContext context) => this.widget.child;
_builder = _build;
}
Widget _build(BuildContext context) => widget.child;
void update(T newWidget) {
T oldWidget = widget;
assert(widget != null);