David PHAM-VAN

Fix InheritedWidget issue with multiple pages

@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 4
5 - Fix justified text softWrap issue 5 - Fix justified text softWrap issue
6 - Set a default color for Dividers 6 - Set a default color for Dividers
  7 +- Fix InheritedWidget issue with multiple pages
7 8
8 ## 1.7.0 9 ## 1.7.0
9 10
@@ -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);