Showing
2 changed files
with
3 additions
and
9 deletions
@@ -203,15 +203,8 @@ class InheritedWidget extends Widget { | @@ -203,15 +203,8 @@ class InheritedWidget extends Widget { | ||
203 | @override | 203 | @override |
204 | void layout(Context context, BoxConstraints constraints, | 204 | void layout(Context context, BoxConstraints constraints, |
205 | {bool parentUsesSize = false}) { | 205 | {bool parentUsesSize = false}) { |
206 | - if (_context == null) { | ||
207 | - // final Inherited inherited = build(context); | ||
208 | - if (inherited != null) { | ||
209 | - _context = context.inheritFrom(inherited); | ||
210 | - } | ||
211 | - } | ||
212 | - | ||
213 | - _context ??= context; | ||
214 | - _child ??= build(_context); | 206 | + _context = inherited != null ? context.inheritFrom(inherited) : context; |
207 | + _child = build(_context); | ||
215 | 208 | ||
216 | if (_child != null) { | 209 | if (_child != null) { |
217 | _child.layout(_context, constraints, parentUsesSize: parentUsesSize); | 210 | _child.layout(_context, constraints, parentUsesSize: parentUsesSize); |
-
Please register or login to post a comment