Commit 7f5d6a99 authored by Adam Barth's avatar Adam Barth

Use a member function instead of an anonymous closure

It's slightly more efficient.
parent fd8695b6
...@@ -1377,9 +1377,11 @@ class StatefulComponentElement<T extends StatefulComponent, U extends State<T>> ...@@ -1377,9 +1377,11 @@ class StatefulComponentElement<T extends StatefulComponent, U extends State<T>>
abstract class _ProxyElement<T extends _ProxyComponent> extends ComponentElement<T> { abstract class _ProxyElement<T extends _ProxyComponent> extends ComponentElement<T> {
_ProxyElement(T widget) : super(widget) { _ProxyElement(T widget) : super(widget) {
_builder = (BuildContext context) => this.widget.child; _builder = _build;
} }
Widget _build(BuildContext context) => widget.child;
void update(T newWidget) { void update(T newWidget) {
T oldWidget = widget; T oldWidget = widget;
assert(widget != null); assert(widget != null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment