Commit 2958d7d0 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

use bool in assert (#12170)

parent cde6b669
...@@ -186,7 +186,7 @@ class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderState ...@@ -186,7 +186,7 @@ class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderState
assert(() { assert(() {
showPreviewBanner = false; showPreviewBanner = false;
return true; return true;
}); }());
if (showPreviewBanner) { if (showPreviewBanner) {
home = new Stack( home = new Stack(
......
...@@ -331,7 +331,7 @@ List<GalleryItem> _buildGalleryItems() { ...@@ -331,7 +331,7 @@ List<GalleryItem> _buildGalleryItems() {
), ),
); );
return true; return true;
}); }());
return galleryItems; return galleryItems;
} }
......
...@@ -114,7 +114,7 @@ class StocksAppState extends State<StocksApp> { ...@@ -114,7 +114,7 @@ class StocksAppState extends State<StocksApp> {
debugPaintPointersEnabled = _configuration.debugShowPointers; debugPaintPointersEnabled = _configuration.debugShowPointers;
debugRepaintRainbowEnabled = _configuration.debugShowRainbow; debugRepaintRainbowEnabled = _configuration.debugShowRainbow;
return true; return true;
}); }());
return new MaterialApp( return new MaterialApp(
title: 'Stocks', title: 'Stocks',
theme: theme, theme: theme,
......
...@@ -199,7 +199,7 @@ class StockSettingsState extends State<StockSettings> { ...@@ -199,7 +199,7 @@ class StockSettingsState extends State<StockSettings> {
), ),
]); ]);
return true; return true;
}); }());
return new ListView( return new ListView(
padding: const EdgeInsets.symmetric(vertical: 20.0), padding: const EdgeInsets.symmetric(vertical: 20.0),
children: rows, children: rows,
......
...@@ -284,7 +284,7 @@ class AnimationController extends Animation<double> ...@@ -284,7 +284,7 @@ class AnimationController extends Animation<double>
); );
} }
return true; return true;
}); }());
_direction = _AnimationDirection.forward; _direction = _AnimationDirection.forward;
if (from != null) if (from != null)
value = from; value = from;
...@@ -312,7 +312,7 @@ class AnimationController extends Animation<double> ...@@ -312,7 +312,7 @@ class AnimationController extends Animation<double>
); );
} }
return true; return true;
}); }());
_direction = _AnimationDirection.reverse; _direction = _AnimationDirection.reverse;
if (from != null) if (from != null)
value = from; value = from;
...@@ -349,7 +349,7 @@ class AnimationController extends Animation<double> ...@@ -349,7 +349,7 @@ class AnimationController extends Animation<double>
); );
} }
return true; return true;
}); }());
final double range = upperBound - lowerBound; final double range = upperBound - lowerBound;
final double remainingFraction = range.isFinite ? (target - _value).abs() / range : 1.0; final double remainingFraction = range.isFinite ? (target - _value).abs() / range : 1.0;
simulationDuration = this.duration * remainingFraction; simulationDuration = this.duration * remainingFraction;
...@@ -399,7 +399,7 @@ class AnimationController extends Animation<double> ...@@ -399,7 +399,7 @@ class AnimationController extends Animation<double>
); );
} }
return true; return true;
}); }());
return animateWith(new _RepeatingSimulation(min, max, period)); return animateWith(new _RepeatingSimulation(min, max, period));
} }
...@@ -483,7 +483,7 @@ class AnimationController extends Animation<double> ...@@ -483,7 +483,7 @@ class AnimationController extends Animation<double>
); );
} }
return true; return true;
}); }());
_ticker.dispose(); _ticker.dispose();
_ticker = null; _ticker = null;
super.dispose(); super.dispose();
......
...@@ -405,7 +405,7 @@ class CurvedAnimation extends Animation<double> with AnimationWithParentMixin<do ...@@ -405,7 +405,7 @@ class CurvedAnimation extends Animation<double> with AnimationWithParentMixin<do
); );
} }
return true; return true;
}); }());
return t; return t;
} }
return activeCurve.transform(t); return activeCurve.transform(t);
......
...@@ -131,7 +131,7 @@ class CupertinoPageRoute<T> extends PageRoute<T> { ...@@ -131,7 +131,7 @@ class CupertinoPageRoute<T> extends PageRoute<T> {
'Cannot install a subsidiary route (one with a hostRoute).\n' 'Cannot install a subsidiary route (one with a hostRoute).\n'
'This route ($this) cannot be installed, because it has a host route ($hostRoute).' 'This route ($this) cannot be installed, because it has a host route ($hostRoute).'
); );
}); }());
super.install(insertionPoint); super.install(insertionPoint);
} }
...@@ -238,7 +238,7 @@ class CupertinoPageRoute<T> extends PageRoute<T> { ...@@ -238,7 +238,7 @@ class CupertinoPageRoute<T> extends PageRoute<T> {
); );
} }
return true; return true;
}); }());
return result; return result;
} }
......
...@@ -136,7 +136,7 @@ class CupertinoTabView extends StatelessWidget { ...@@ -136,7 +136,7 @@ class CupertinoTabView extends StatelessWidget {
); );
} }
return true; return true;
}); }());
final Route<dynamic> result = onUnknownRoute(settings); final Route<dynamic> result = onUnknownRoute(settings);
assert(() { assert(() {
if (result == null) { if (result == null) {
...@@ -148,7 +148,7 @@ class CupertinoTabView extends StatelessWidget { ...@@ -148,7 +148,7 @@ class CupertinoTabView extends StatelessWidget {
); );
} }
return true; return true;
}); }());
return result; return result;
} }
} }
\ No newline at end of file
...@@ -222,7 +222,7 @@ class FlutterError extends AssertionError { ...@@ -222,7 +222,7 @@ class FlutterError extends AssertionError {
// In checked mode, we ignore the "silent" flag. // In checked mode, we ignore the "silent" flag.
reportError = true; reportError = true;
return true; return true;
}); }());
if (!reportError && !forceReport) if (!reportError && !forceReport)
return; return;
if (_errorCount == 0 || forceReport) { if (_errorCount == 0 || forceReport) {
......
...@@ -77,7 +77,7 @@ abstract class BindingBase { ...@@ -77,7 +77,7 @@ abstract class BindingBase {
@mustCallSuper @mustCallSuper
void initInstances() { void initInstances() {
assert(!_debugInitialized); assert(!_debugInitialized);
assert(() { _debugInitialized = true; return true; }); assert(() { _debugInitialized = true; return true; }());
} }
/// Called when the binding is initialized, to register service /// Called when the binding is initialized, to register service
...@@ -145,8 +145,8 @@ abstract class BindingBase { ...@@ -145,8 +145,8 @@ abstract class BindingBase {
} }
); );
return true; return true;
}); }());
assert(() { _debugServiceExtensionsRegistered = true; return true; }); assert(() { _debugServiceExtensionsRegistered = true; return true; }());
} }
/// Whether [lockEvents] is currently locking events. /// Whether [lockEvents] is currently locking events.
......
...@@ -54,7 +54,7 @@ class ChangeNotifier extends Listenable { ...@@ -54,7 +54,7 @@ class ChangeNotifier extends Listenable {
); );
} }
return true; return true;
}); }());
return true; return true;
} }
...@@ -63,7 +63,7 @@ class ChangeNotifier extends Listenable { ...@@ -63,7 +63,7 @@ class ChangeNotifier extends Listenable {
/// This method must not be called after [dispose] has been called. /// This method must not be called after [dispose] has been called.
@override @override
void addListener(VoidCallback listener) { void addListener(VoidCallback listener) {
assert(_debugAssertNotDisposed); assert(_debugAssertNotDisposed());
_listeners.add(listener); _listeners.add(listener);
} }
...@@ -88,7 +88,7 @@ class ChangeNotifier extends Listenable { ...@@ -88,7 +88,7 @@ class ChangeNotifier extends Listenable {
/// registrations to a common upstream object. /// registrations to a common upstream object.
@override @override
void removeListener(VoidCallback listener) { void removeListener(VoidCallback listener) {
assert(_debugAssertNotDisposed); assert(_debugAssertNotDisposed());
_listeners.remove(listener); _listeners.remove(listener);
} }
...@@ -100,7 +100,7 @@ class ChangeNotifier extends Listenable { ...@@ -100,7 +100,7 @@ class ChangeNotifier extends Listenable {
/// This method should only be called by the object's owner. /// This method should only be called by the object's owner.
@mustCallSuper @mustCallSuper
void dispose() { void dispose() {
assert(_debugAssertNotDisposed); assert(_debugAssertNotDisposed());
_listeners = null; _listeners = null;
} }
...@@ -121,7 +121,7 @@ class ChangeNotifier extends Listenable { ...@@ -121,7 +121,7 @@ class ChangeNotifier extends Listenable {
/// See the discussion at [removeListener]. /// See the discussion at [removeListener].
@protected @protected
void notifyListeners() { void notifyListeners() {
assert(_debugAssertNotDisposed); assert(_debugAssertNotDisposed());
if (_listeners != null) { if (_listeners != null) {
final List<VoidCallback> localListeners = new List<VoidCallback>.from(_listeners); final List<VoidCallback> localListeners = new List<VoidCallback>.from(_listeners);
for (VoidCallback listener in localListeners) { for (VoidCallback listener in localListeners) {
......
...@@ -25,7 +25,7 @@ bool debugAssertAllFoundationVarsUnset(String reason, { DebugPrintCallback debug ...@@ -25,7 +25,7 @@ bool debugAssertAllFoundationVarsUnset(String reason, { DebugPrintCallback debug
debugDefaultTargetPlatformOverride != null) debugDefaultTargetPlatformOverride != null)
throw new FlutterError(reason); throw new FlutterError(reason);
return true; return true;
}); }());
return true; return true;
} }
......
...@@ -45,7 +45,7 @@ TargetPlatform get defaultTargetPlatform { ...@@ -45,7 +45,7 @@ TargetPlatform get defaultTargetPlatform {
if (debugDefaultTargetPlatformOverride != null) if (debugDefaultTargetPlatformOverride != null)
result = debugDefaultTargetPlatformOverride; result = debugDefaultTargetPlatformOverride;
return true; return true;
}); }());
if (result == null) { if (result == null) {
throw new FlutterError( throw new FlutterError(
'Unknown platform.\n' 'Unknown platform.\n'
......
...@@ -271,7 +271,7 @@ class GestureArenaManager { ...@@ -271,7 +271,7 @@ class GestureArenaManager {
debugPrint('Gesture arena ${pointer.toString().padRight(4)}$message${ count != null ? " with $count member$s." : ""}'); debugPrint('Gesture arena ${pointer.toString().padRight(4)}$message${ count != null ? " with $count member$s." : ""}');
} }
return true; return true;
}); }());
return true; return true;
} }
} }
...@@ -89,7 +89,7 @@ abstract class GestureBinding extends BindingBase with HitTestable, HitTestDispa ...@@ -89,7 +89,7 @@ abstract class GestureBinding extends BindingBase with HitTestable, HitTestDispa
if (debugPrintHitTestResults) if (debugPrintHitTestResults)
debugPrint('$event: $result'); debugPrint('$event: $result');
return true; return true;
}); }());
} else if (event is PointerUpEvent || event is PointerCancelEvent) { } else if (event is PointerUpEvent || event is PointerCancelEvent) {
result = _hitTests.remove(event.pointer); result = _hitTests.remove(event.pointer);
} else if (event.down) { } else if (event.down) {
......
...@@ -54,6 +54,6 @@ bool debugAssertAllGesturesVarsUnset(String reason) { ...@@ -54,6 +54,6 @@ bool debugAssertAllGesturesVarsUnset(String reason) {
debugPrintRecognizerCallbacksTrace) debugPrintRecognizerCallbacksTrace)
throw new FlutterError(reason); throw new FlutterError(reason);
return true; return true;
}); }());
return true; return true;
} }
...@@ -163,7 +163,7 @@ abstract class MultiDragPointerState { ...@@ -163,7 +163,7 @@ abstract class MultiDragPointerState {
void dispose() { void dispose() {
_arenaEntry?.resolve(GestureDisposition.rejected); _arenaEntry?.resolve(GestureDisposition.rejected);
_arenaEntry = null; _arenaEntry = null;
assert(() { _pendingDelta = null; return true; }); assert(() { _pendingDelta = null; return true; }());
} }
} }
......
...@@ -98,7 +98,7 @@ abstract class GestureRecognizer extends GestureArenaMember with DiagnosticableT ...@@ -98,7 +98,7 @@ abstract class GestureRecognizer extends GestureArenaMember with DiagnosticableT
debugPrint('$prefix$this calling $name callback.${ report?.isNotEmpty == true ? " $report" : "" }'); debugPrint('$prefix$this calling $name callback.${ report?.isNotEmpty == true ? " $report" : "" }');
} }
return true; return true;
}); }());
result = callback(); result = callback();
} catch (exception, stack) { } catch (exception, stack) {
FlutterError.reportError(new FlutterErrorDetails( FlutterError.reportError(new FlutterErrorDetails(
......
...@@ -504,7 +504,7 @@ class _MaterialAppState extends State<MaterialApp> { ...@@ -504,7 +504,7 @@ class _MaterialAppState extends State<MaterialApp> {
); );
} }
return true; return true;
}); }());
final Route<dynamic> result = widget.onUnknownRoute(settings); final Route<dynamic> result = widget.onUnknownRoute(settings);
assert(() { assert(() {
if (result == null) { if (result == null) {
...@@ -516,7 +516,7 @@ class _MaterialAppState extends State<MaterialApp> { ...@@ -516,7 +516,7 @@ class _MaterialAppState extends State<MaterialApp> {
); );
} }
return true; return true;
}); }());
return result; return result;
} }
...@@ -569,7 +569,7 @@ class _MaterialAppState extends State<MaterialApp> { ...@@ -569,7 +569,7 @@ class _MaterialAppState extends State<MaterialApp> {
); );
} }
return true; return true;
}); }());
return new ScrollConfiguration( return new ScrollConfiguration(
behavior: new _MaterialScrollBehavior(), behavior: new _MaterialScrollBehavior(),
......
...@@ -38,6 +38,6 @@ bool debugCheckHasMaterial(BuildContext context) { ...@@ -38,6 +38,6 @@ bool debugCheckHasMaterial(BuildContext context) {
); );
} }
return true; return true;
}); }());
return true; return true;
} }
...@@ -226,7 +226,7 @@ class _DropdownMenuRouteLayout<T> extends SingleChildLayoutDelegate { ...@@ -226,7 +226,7 @@ class _DropdownMenuRouteLayout<T> extends SingleChildLayoutDelegate {
assert(menuTop + menuHeight <= size.height); assert(menuTop + menuHeight <= size.height);
} }
return true; return true;
}); }());
return new Offset(buttonRect.left.clamp(0.0, size.width - childSize.width), menuTop); return new Offset(buttonRect.left.clamp(0.0, size.width - childSize.width), menuTop);
} }
......
...@@ -394,7 +394,7 @@ abstract class InkFeature { ...@@ -394,7 +394,7 @@ abstract class InkFeature {
@mustCallSuper @mustCallSuper
void dispose() { void dispose() {
assert(!_debugDisposed); assert(!_debugDisposed);
assert(() { _debugDisposed = true; return true; }); assert(() { _debugDisposed = true; return true; }());
_controller._removeFeature(this); _controller._removeFeature(this);
if (onRemoved != null) if (onRemoved != null)
onRemoved(); onRemoved();
......
...@@ -282,7 +282,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations { ...@@ -282,7 +282,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations {
); );
} }
return true; return true;
}); }());
return _icuTimeOfDayToEnum[icuShortTimePattern]; return _icuTimeOfDayToEnum[icuShortTimePattern];
} }
......
...@@ -134,7 +134,7 @@ class MaterialPageRoute<T> extends PageRoute<T> { ...@@ -134,7 +134,7 @@ class MaterialPageRoute<T> extends PageRoute<T> {
); );
} }
return true; return true;
}); }());
return result; return result;
} }
......
...@@ -85,7 +85,7 @@ class PaginatedDataTable extends StatefulWidget { ...@@ -85,7 +85,7 @@ class PaginatedDataTable extends StatefulWidget {
if (onRowsPerPageChanged != null) if (onRowsPerPageChanged != null)
assert(availableRowsPerPage != null && availableRowsPerPage.contains(rowsPerPage)); assert(availableRowsPerPage != null && availableRowsPerPage.contains(rowsPerPage));
return true; return true;
}), }()),
assert(source != null), assert(source != null),
super(key: key); super(key: key);
......
...@@ -626,7 +626,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin { ...@@ -626,7 +626,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
'https://material.google.com/components/steppers.html#steppers-usage\n' 'https://material.google.com/components/steppers.html#steppers-usage\n'
); );
return true; return true;
}); }());
assert(widget.type != null); assert(widget.type != null);
switch (widget.type) { switch (widget.type) {
case StepperType.vertical: case StepperType.vertical:
......
...@@ -546,7 +546,7 @@ class _TabBarState extends State<TabBar> { ...@@ -546,7 +546,7 @@ class _TabBarState extends State<TabBar> {
); );
} }
return true; return true;
}); }());
if (newController == _controller) if (newController == _controller)
return; return;
...@@ -855,7 +855,7 @@ class _TabBarViewState extends State<TabBarView> { ...@@ -855,7 +855,7 @@ class _TabBarViewState extends State<TabBarView> {
); );
} }
return true; return true;
}); }());
if (newController == _controller) if (newController == _controller)
return; return;
...@@ -1113,7 +1113,7 @@ class TabPageSelector extends StatelessWidget { ...@@ -1113,7 +1113,7 @@ class TabPageSelector extends StatelessWidget {
); );
} }
return true; return true;
}); }());
final Animation<double> animation = new CurvedAnimation( final Animation<double> animation = new CurvedAnimation(
parent: tabController.animation, parent: tabController.animation,
curve: Curves.fastOutSlowIn, curve: Curves.fastOutSlowIn,
......
...@@ -162,7 +162,7 @@ class FlutterLogoDecoration extends Decoration { ...@@ -162,7 +162,7 @@ class FlutterLogoDecoration extends Decoration {
assert(debugAssertIsValid()); assert(debugAssertIsValid());
if (a is! FlutterLogoDecoration) if (a is! FlutterLogoDecoration)
return lerp(null, this, t); return lerp(null, this, t);
assert(a.debugAssertIsValid); assert(a.debugAssertIsValid());
return lerp(a, this, t); return lerp(a, this, t);
} }
......
...@@ -367,7 +367,7 @@ class TextPainter { ...@@ -367,7 +367,7 @@ class TextPainter {
); );
} }
return true; return true;
}); }());
canvas.drawParagraph(_paragraph, offset); canvas.drawParagraph(_paragraph, offset);
} }
......
...@@ -275,7 +275,7 @@ class TextSpan extends DiagnosticableTree { ...@@ -275,7 +275,7 @@ class TextSpan extends DiagnosticableTree {
); );
} }
return true; return true;
}); }());
return true; return true;
} }
......
...@@ -86,7 +86,7 @@ abstract class RendererBinding extends BindingBase with SchedulerBinding, Servic ...@@ -86,7 +86,7 @@ abstract class RendererBinding extends BindingBase with SchedulerBinding, Servic
} }
); );
return true; return true;
}); }());
registerSignalServiceExtension( registerSignalServiceExtension(
name: 'debugDumpRenderTree', name: 'debugDumpRenderTree',
......
...@@ -98,7 +98,7 @@ class RenderListBody extends RenderBox ...@@ -98,7 +98,7 @@ class RenderListBody extends RenderBox
'axis. You probably want to put the RenderListBody inside a ' 'axis. You probably want to put the RenderListBody inside a '
'RenderViewport with a matching main axis.' 'RenderViewport with a matching main axis.'
); );
}); }());
assert(() { assert(() {
switch (mainAxis) { switch (mainAxis) {
case Axis.horizontal: case Axis.horizontal:
...@@ -123,7 +123,7 @@ class RenderListBody extends RenderBox ...@@ -123,7 +123,7 @@ class RenderListBody extends RenderBox
'for example, a RenderIntrinsicWidth or RenderIntrinsicHeight object. ' 'for example, a RenderIntrinsicWidth or RenderIntrinsicHeight object. '
'This is relatively expensive, however.' // (that's why we don't do it automatically) 'This is relatively expensive, however.' // (that's why we don't do it automatically)
); );
}); }());
final BoxConstraints innerConstraints = _getInnerConstraints(constraints); final BoxConstraints innerConstraints = _getInnerConstraints(constraints);
double position = 0.0; double position = 0.0;
RenderBox child = firstChild; RenderBox child = firstChild;
......
...@@ -260,7 +260,7 @@ class BoxConstraints extends Constraints { ...@@ -260,7 +260,7 @@ class BoxConstraints extends Constraints {
if (size is _DebugSize) if (size is _DebugSize)
result = new _DebugSize(result, size._owner, size._canBeUsedByParent); result = new _DebugSize(result, size._owner, size._canBeUsedByParent);
return true; return true;
}); }());
return result; return result;
} }
...@@ -271,7 +271,7 @@ class BoxConstraints extends Constraints { ...@@ -271,7 +271,7 @@ class BoxConstraints extends Constraints {
/// separately provided widths and heights. /// separately provided widths and heights.
Size constrain(Size size) { Size constrain(Size size) {
Size result = new Size(constrainWidth(size.width), constrainHeight(size.height)); Size result = new Size(constrainWidth(size.width), constrainHeight(size.height));
assert(() { result = _debugPropagateDebugSize(size, result); return true; }); assert(() { result = _debugPropagateDebugSize(size, result); return true; }());
return result; return result;
} }
...@@ -294,7 +294,7 @@ class BoxConstraints extends Constraints { ...@@ -294,7 +294,7 @@ class BoxConstraints extends Constraints {
Size constrainSizeAndAttemptToPreserveAspectRatio(Size size) { Size constrainSizeAndAttemptToPreserveAspectRatio(Size size) {
if (isTight) { if (isTight) {
Size result = smallest; Size result = smallest;
assert(() { result = _debugPropagateDebugSize(size, result); return true; }); assert(() { result = _debugPropagateDebugSize(size, result); return true; }());
return result; return result;
} }
...@@ -325,7 +325,7 @@ class BoxConstraints extends Constraints { ...@@ -325,7 +325,7 @@ class BoxConstraints extends Constraints {
} }
Size result = new Size(constrainWidth(width), constrainHeight(height)); Size result = new Size(constrainWidth(width), constrainHeight(height));
assert(() { result = _debugPropagateDebugSize(size, result); return true; }); assert(() { result = _debugPropagateDebugSize(size, result); return true; }());
return result; return result;
} }
...@@ -495,7 +495,7 @@ class BoxConstraints extends Constraints { ...@@ -495,7 +495,7 @@ class BoxConstraints extends Constraints {
} }
assert(isNormalized); assert(isNormalized);
return true; return true;
}); }());
return isNormalized; return isNormalized;
} }
...@@ -1038,7 +1038,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1038,7 +1038,7 @@ abstract class RenderBox extends RenderObject {
if (RenderObject.debugCheckingIntrinsics) if (RenderObject.debugCheckingIntrinsics)
shouldCache = false; shouldCache = false;
return true; return true;
}); }());
if (shouldCache) { if (shouldCache) {
_cachedIntrinsicDimensions ??= <_IntrinsicDimensionsCacheEntry, double>{}; _cachedIntrinsicDimensions ??= <_IntrinsicDimensionsCacheEntry, double>{};
return _cachedIntrinsicDimensions.putIfAbsent( return _cachedIntrinsicDimensions.putIfAbsent(
...@@ -1085,7 +1085,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1085,7 +1085,7 @@ abstract class RenderBox extends RenderObject {
); );
} }
return true; return true;
}); }());
return _computeIntrinsicDimension(_IntrinsicDimension.minWidth, height, computeMinIntrinsicWidth); return _computeIntrinsicDimension(_IntrinsicDimension.minWidth, height, computeMinIntrinsicWidth);
} }
...@@ -1224,7 +1224,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1224,7 +1224,7 @@ abstract class RenderBox extends RenderObject {
); );
} }
return true; return true;
}); }());
return _computeIntrinsicDimension(_IntrinsicDimension.maxWidth, height, computeMaxIntrinsicWidth); return _computeIntrinsicDimension(_IntrinsicDimension.maxWidth, height, computeMaxIntrinsicWidth);
} }
...@@ -1300,7 +1300,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1300,7 +1300,7 @@ abstract class RenderBox extends RenderObject {
); );
} }
return true; return true;
}); }());
return _computeIntrinsicDimension(_IntrinsicDimension.minHeight, width, computeMinIntrinsicHeight); return _computeIntrinsicDimension(_IntrinsicDimension.minHeight, width, computeMinIntrinsicHeight);
} }
...@@ -1373,7 +1373,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1373,7 +1373,7 @@ abstract class RenderBox extends RenderObject {
); );
} }
return true; return true;
}); }());
return _computeIntrinsicDimension(_IntrinsicDimension.maxHeight, width, computeMaxIntrinsicHeight); return _computeIntrinsicDimension(_IntrinsicDimension.maxHeight, width, computeMaxIntrinsicHeight);
} }
...@@ -1443,7 +1443,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1443,7 +1443,7 @@ abstract class RenderBox extends RenderObject {
assert(_size == this._size); assert(_size == this._size);
} }
return true; return true;
}); }());
return _size; return _size;
} }
Size _size; Size _size;
...@@ -1481,13 +1481,13 @@ abstract class RenderBox extends RenderObject { ...@@ -1481,13 +1481,13 @@ abstract class RenderBox extends RenderObject {
'The RenderBox in question is:\n' 'The RenderBox in question is:\n'
' $this' ' $this'
); );
}); }());
assert(() { assert(() {
value = debugAdoptSize(value); value = debugAdoptSize(value);
return true; return true;
}); }());
_size = value; _size = value;
assert(() { debugAssertDoesMeetConstraints(); return true; }); assert(() { debugAssertDoesMeetConstraints(); return true; }());
} }
/// Claims ownership of the given [Size]. /// Claims ownership of the given [Size].
...@@ -1549,7 +1549,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1549,7 +1549,7 @@ abstract class RenderBox extends RenderObject {
} }
result = new _DebugSize(value, this, debugCanParentUseSize); result = new _DebugSize(value, this, debugCanParentUseSize);
return true; return true;
}); }());
return result; return result;
} }
...@@ -1594,7 +1594,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1594,7 +1594,7 @@ abstract class RenderBox extends RenderObject {
((RenderObject.debugActivePaint == this) && debugDoingThisPaint); ((RenderObject.debugActivePaint == this) && debugDoingThisPaint);
assert(parent == this.parent); assert(parent == this.parent);
return false; return false;
}); }());
assert(_debugSetDoingBaseline(true)); assert(_debugSetDoingBaseline(true));
final double result = getDistanceToActualBaseline(baseline); final double result = getDistanceToActualBaseline(baseline);
assert(_debugSetDoingBaseline(false)); assert(_debugSetDoingBaseline(false));
...@@ -1752,7 +1752,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1752,7 +1752,7 @@ abstract class RenderBox extends RenderObject {
} }
} }
return true; return true;
}); }());
} }
@override @override
...@@ -1793,7 +1793,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1793,7 +1793,7 @@ abstract class RenderBox extends RenderObject {
); );
} }
return true; return true;
}); }());
} }
/// Determines the set of render objects located at the given position. /// Determines the set of render objects located at the given position.
...@@ -1840,7 +1840,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1840,7 +1840,7 @@ abstract class RenderBox extends RenderObject {
); );
} }
return true; return true;
}); }());
if (_size.contains(position)) { if (_size.contains(position)) {
if (hitTestChildren(result, position: position) || hitTestSelf(position)) { if (hitTestChildren(result, position: position) || hitTestSelf(position)) {
result.add(new BoxHitTestEntry(this, position)); result.add(new BoxHitTestEntry(this, position));
...@@ -1901,7 +1901,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1901,7 +1901,7 @@ abstract class RenderBox extends RenderObject {
); );
} }
return true; return true;
}); }());
final BoxParentData childParentData = child.parentData; final BoxParentData childParentData = child.parentData;
final Offset offset = childParentData.offset; final Offset offset = childParentData.offset;
transform.translate(offset.dx, offset.dy); transform.translate(offset.dx, offset.dy);
...@@ -2004,7 +2004,7 @@ abstract class RenderBox extends RenderObject { ...@@ -2004,7 +2004,7 @@ abstract class RenderBox extends RenderObject {
markNeedsPaint(); markNeedsPaint();
} }
return true; return true;
}); }());
return true; return true;
} }
...@@ -2018,7 +2018,7 @@ abstract class RenderBox extends RenderObject { ...@@ -2018,7 +2018,7 @@ abstract class RenderBox extends RenderObject {
if (debugPaintPointersEnabled) if (debugPaintPointersEnabled)
debugPaintPointers(context, offset); debugPaintPointers(context, offset);
return true; return true;
}); }());
} }
/// In debug mode, paints a border around this render box. /// In debug mode, paints a border around this render box.
...@@ -2033,7 +2033,7 @@ abstract class RenderBox extends RenderObject { ...@@ -2033,7 +2033,7 @@ abstract class RenderBox extends RenderObject {
..color = const Color(0xFF00FFFF); ..color = const Color(0xFF00FFFF);
context.canvas.drawRect((offset & size).deflate(0.5), paint); context.canvas.drawRect((offset & size).deflate(0.5), paint);
return true; return true;
}); }());
} }
/// In debug mode, paints a line for each baseline. /// In debug mode, paints a line for each baseline.
...@@ -2065,7 +2065,7 @@ abstract class RenderBox extends RenderObject { ...@@ -2065,7 +2065,7 @@ abstract class RenderBox extends RenderObject {
context.canvas.drawPath(path, paint); context.canvas.drawPath(path, paint);
} }
return true; return true;
}); }());
} }
/// In debug mode, paints a rectangle if this render box has counted more /// In debug mode, paints a rectangle if this render box has counted more
...@@ -2084,7 +2084,7 @@ abstract class RenderBox extends RenderObject { ...@@ -2084,7 +2084,7 @@ abstract class RenderBox extends RenderObject {
context.canvas.drawRect(offset & size, paint); context.canvas.drawRect(offset & size, paint);
} }
return true; return true;
}); }());
} }
@override @override
......
...@@ -120,7 +120,7 @@ abstract class MultiChildLayoutDelegate { ...@@ -120,7 +120,7 @@ abstract class MultiChildLayoutDelegate {
); );
} }
return true; return true;
}); }());
child.layout(constraints, parentUsesSize: true); child.layout(constraints, parentUsesSize: true);
return child.size; return child.size;
} }
...@@ -146,7 +146,7 @@ abstract class MultiChildLayoutDelegate { ...@@ -146,7 +146,7 @@ abstract class MultiChildLayoutDelegate {
); );
} }
return true; return true;
}); }());
final MultiChildLayoutParentData childParentData = child.parentData; final MultiChildLayoutParentData childParentData = child.parentData;
childParentData.offset = offset; childParentData.offset = offset;
} }
...@@ -167,7 +167,7 @@ abstract class MultiChildLayoutDelegate { ...@@ -167,7 +167,7 @@ abstract class MultiChildLayoutDelegate {
debugPreviousChildrenNeedingLayout = _debugChildrenNeedingLayout; debugPreviousChildrenNeedingLayout = _debugChildrenNeedingLayout;
_debugChildrenNeedingLayout = new Set<RenderBox>(); _debugChildrenNeedingLayout = new Set<RenderBox>();
return true; return true;
}); }());
try { try {
_idToChild = <Object, RenderBox>{}; _idToChild = <Object, RenderBox>{};
...@@ -183,12 +183,12 @@ abstract class MultiChildLayoutDelegate { ...@@ -183,12 +183,12 @@ abstract class MultiChildLayoutDelegate {
); );
} }
return true; return true;
}); }());
_idToChild[childParentData.id] = child; _idToChild[childParentData.id] = child;
assert(() { assert(() {
_debugChildrenNeedingLayout.add(child); _debugChildrenNeedingLayout.add(child);
return true; return true;
}); }());
child = childParentData.nextSibling; child = childParentData.nextSibling;
} }
performLayout(size); performLayout(size);
...@@ -209,13 +209,13 @@ abstract class MultiChildLayoutDelegate { ...@@ -209,13 +209,13 @@ abstract class MultiChildLayoutDelegate {
} }
} }
return true; return true;
}); }());
} finally { } finally {
_idToChild = previousIdToChild; _idToChild = previousIdToChild;
assert(() { assert(() {
_debugChildrenNeedingLayout = debugPreviousChildrenNeedingLayout; _debugChildrenNeedingLayout = debugPreviousChildrenNeedingLayout;
return true; return true;
}); }());
} }
} }
......
...@@ -203,7 +203,7 @@ void debugPaintPadding(Canvas canvas, Rect outerRect, Rect innerRect, { double o ...@@ -203,7 +203,7 @@ void debugPaintPadding(Canvas canvas, Rect outerRect, Rect innerRect, { double o
canvas.drawRect(outerRect, paint); canvas.drawRect(outerRect, paint);
} }
return true; return true;
}); }());
} }
/// Returns true if none of the rendering library debug variables have been changed. /// Returns true if none of the rendering library debug variables have been changed.
...@@ -234,6 +234,6 @@ bool debugAssertAllRenderVarsUnset(String reason, { bool debugCheckIntrinsicSize ...@@ -234,6 +234,6 @@ bool debugAssertAllRenderVarsUnset(String reason, { bool debugCheckIntrinsicSize
throw new FlutterError(reason); throw new FlutterError(reason);
} }
return true; return true;
}); }());
return true; return true;
} }
...@@ -705,7 +705,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -705,7 +705,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
'If none of the above helps enough to fix this problem, please don\'t hesitate to file a bug:\n' 'If none of the above helps enough to fix this problem, please don\'t hesitate to file a bug:\n'
' https://github.com/flutter/flutter/issues/new' ' https://github.com/flutter/flutter/issues/new'
); );
}); }());
totalFlex += childParentData.flex; totalFlex += childParentData.flex;
} else { } else {
BoxConstraints innerConstraints; BoxConstraints innerConstraints;
...@@ -798,7 +798,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -798,7 +798,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
if (textBaseline == null) if (textBaseline == null)
throw new FlutterError('To use FlexAlignItems.baseline, you must also specify which baseline to use using the "baseline" argument.'); throw new FlutterError('To use FlexAlignItems.baseline, you must also specify which baseline to use using the "baseline" argument.');
return true; return true;
}); }());
final double distance = child.getDistanceToBaseline(textBaseline, onlyReal: true); final double distance = child.getDistanceToBaseline(textBaseline, onlyReal: true);
if (distance != null) if (distance != null)
maxBaselineDistance = math.max(maxBaselineDistance, distance); maxBaselineDistance = math.max(maxBaselineDistance, distance);
...@@ -1017,7 +1017,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -1017,7 +1017,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
} }
return true; return true;
}); }());
} }
@override @override
......
...@@ -326,7 +326,7 @@ class RenderFlow extends RenderBox ...@@ -326,7 +326,7 @@ class RenderFlow extends RenderBox
); );
} }
return true; return true;
}); }());
_lastPaintOrder.add(i); _lastPaintOrder.add(i);
childParentData._transform = transform; childParentData._transform = transform;
......
...@@ -76,7 +76,7 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin { ...@@ -76,7 +76,7 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin {
node = node.parent; node = node.parent;
assert(node != newLayer); // indicates we are about to create a cycle assert(node != newLayer); // indicates we are about to create a cycle
return true; return true;
}); }());
parent.adoptChild(newLayer); parent.adoptChild(newLayer);
assert(newLayer.attached == parent.attached); assert(newLayer.attached == parent.attached);
if (parent.firstChild == this) if (parent.firstChild == this)
...@@ -299,7 +299,7 @@ class ContainerLayer extends Layer { ...@@ -299,7 +299,7 @@ class ContainerLayer extends Layer {
node = node.parent; node = node.parent;
assert(node != child); // indicates we are about to create a cycle assert(node != child); // indicates we are about to create a cycle
return true; return true;
}); }());
adoptChild(child); adoptChild(child);
child._previousSibling = lastChild; child._previousSibling = lastChild;
if (lastChild != null) if (lastChild != null)
......
...@@ -122,7 +122,7 @@ class AbstractNode { ...@@ -122,7 +122,7 @@ class AbstractNode {
node = node.parent; node = node.parent;
assert(node != child); // indicates we are about to create a cycle assert(node != child); // indicates we are about to create a cycle
return true; return true;
}); }());
child._parent = this; child._parent = this;
if (attached) if (attached)
child.attach(_owner); child.attach(_owner);
......
...@@ -101,7 +101,7 @@ class PaintingContext { ...@@ -101,7 +101,7 @@ class PaintingContext {
includedChild: true, includedChild: true,
); );
return true; return true;
}); }());
if (child._layer == null) { if (child._layer == null) {
assert(debugAlsoPaintedParent); assert(debugAlsoPaintedParent);
child._layer = new OffsetLayer(); child._layer = new OffsetLayer();
...@@ -112,7 +112,7 @@ class PaintingContext { ...@@ -112,7 +112,7 @@ class PaintingContext {
assert(() { assert(() {
child._layer.debugCreator = child.debugCreator ?? child.runtimeType; child._layer.debugCreator = child.debugCreator ?? child.runtimeType;
return true; return true;
}); }());
final PaintingContext childContext = new PaintingContext._(child._layer, child.paintBounds); final PaintingContext childContext = new PaintingContext._(child._layer, child.paintBounds);
child._paintWithContext(childContext, Offset.zero); child._paintWithContext(childContext, Offset.zero);
childContext._stopRecordingIfNeeded(); childContext._stopRecordingIfNeeded();
...@@ -128,7 +128,7 @@ class PaintingContext { ...@@ -128,7 +128,7 @@ class PaintingContext {
if (debugProfilePaintsEnabled) if (debugProfilePaintsEnabled)
Timeline.startSync('${child.runtimeType}', arguments: timelineWhitelistArguments); Timeline.startSync('${child.runtimeType}', arguments: timelineWhitelistArguments);
return true; return true;
}); }());
if (child.isRepaintBoundary) { if (child.isRepaintBoundary) {
_stopRecordingIfNeeded(); _stopRecordingIfNeeded();
...@@ -141,7 +141,7 @@ class PaintingContext { ...@@ -141,7 +141,7 @@ class PaintingContext {
if (debugProfilePaintsEnabled) if (debugProfilePaintsEnabled)
Timeline.finishSync(); Timeline.finishSync();
return true; return true;
}); }());
} }
void _compositeChild(RenderObject child, Offset offset) { void _compositeChild(RenderObject child, Offset offset) {
...@@ -162,7 +162,7 @@ class PaintingContext { ...@@ -162,7 +162,7 @@ class PaintingContext {
); );
child._layer.debugCreator = child.debugCreator ?? child; child._layer.debugCreator = child.debugCreator ?? child;
return true; return true;
}); }());
} }
child._layer.offset = offset; child._layer.offset = offset;
_appendLayer(child._layer); _appendLayer(child._layer);
...@@ -187,7 +187,7 @@ class PaintingContext { ...@@ -187,7 +187,7 @@ class PaintingContext {
assert(_canvas == null); assert(_canvas == null);
} }
return true; return true;
}); }());
return hasCanvas; return hasCanvas;
} }
...@@ -236,7 +236,7 @@ class PaintingContext { ...@@ -236,7 +236,7 @@ class PaintingContext {
canvas.drawRect(canvasBounds, paint); canvas.drawRect(canvasBounds, paint);
} }
return true; return true;
}); }());
_currentLayer.picture = _recorder.endRecording(); _currentLayer.picture = _recorder.endRecording();
_currentLayer = null; _currentLayer = null;
_recorder = null; _recorder = null;
...@@ -633,7 +633,7 @@ abstract class _SemanticsFragment { ...@@ -633,7 +633,7 @@ abstract class _SemanticsFragment {
for (_SemanticsFragment child in children) for (_SemanticsFragment child in children)
assert(seenChildren.add(child)); // check for duplicate adds assert(seenChildren.add(child)); // check for duplicate adds
return true; return true;
}), }()),
_ancestorChain = <RenderObject>[renderObjectOwner], _ancestorChain = <RenderObject>[renderObjectOwner],
_children = children ?? const <_SemanticsFragment>[]; _children = children ?? const <_SemanticsFragment>[];
...@@ -691,7 +691,7 @@ class _CleanSemanticsFragment extends _SemanticsFragment { ...@@ -691,7 +691,7 @@ class _CleanSemanticsFragment extends _SemanticsFragment {
@override @override
Iterable<SemanticsNode> compile({ _SemanticsGeometry geometry, SemanticsNode currentSemantics, SemanticsNode parentSemantics }) sync* { Iterable<SemanticsNode> compile({ _SemanticsGeometry geometry, SemanticsNode currentSemantics, SemanticsNode parentSemantics }) sync* {
assert(!_debugCompiled); assert(!_debugCompiled);
assert(() { _debugCompiled = true; return true; }); assert(() { _debugCompiled = true; return true; }());
final SemanticsNode node = renderObjectOwner._semantics; final SemanticsNode node = renderObjectOwner._semantics;
assert(node != null); assert(node != null);
if (geometry != null) { if (geometry != null) {
...@@ -715,7 +715,7 @@ abstract class _InterestingSemanticsFragment extends _SemanticsFragment { ...@@ -715,7 +715,7 @@ abstract class _InterestingSemanticsFragment extends _SemanticsFragment {
@override @override
Iterable<SemanticsNode> compile({ _SemanticsGeometry geometry, SemanticsNode currentSemantics, SemanticsNode parentSemantics }) sync* { Iterable<SemanticsNode> compile({ _SemanticsGeometry geometry, SemanticsNode currentSemantics, SemanticsNode parentSemantics }) sync* {
assert(!_debugCompiled); assert(!_debugCompiled);
assert(() { _debugCompiled = true; return true; }); assert(() { _debugCompiled = true; return true; }());
final SemanticsNode node = establishSemanticsNode(geometry, currentSemantics, parentSemantics); final SemanticsNode node = establishSemanticsNode(geometry, currentSemantics, parentSemantics);
final List<SemanticsNode> children = <SemanticsNode>[]; final List<SemanticsNode> children = <SemanticsNode>[];
for (_SemanticsFragment child in _children) { for (_SemanticsFragment child in _children) {
...@@ -906,7 +906,7 @@ class _ForkingSemanticsFragment extends _SemanticsFragment { ...@@ -906,7 +906,7 @@ class _ForkingSemanticsFragment extends _SemanticsFragment {
SemanticsNode parentSemantics SemanticsNode parentSemantics
}) sync* { }) sync* {
assert(!_debugCompiled); assert(!_debugCompiled);
assert(() { _debugCompiled = true; return true; }); assert(() { _debugCompiled = true; return true; }());
assert(geometry != null); assert(geometry != null);
geometry.applyAncestorChain(_ancestorChain); geometry.applyAncestorChain(_ancestorChain);
for (_SemanticsFragment child in _children) { for (_SemanticsFragment child in _children) {
...@@ -964,7 +964,7 @@ class SemanticsHandle { ...@@ -964,7 +964,7 @@ class SemanticsHandle {
); );
} }
return true; return true;
}); }());
if (_owner != null) { if (_owner != null) {
if (listener != null) if (listener != null)
_owner.semanticsOwner.removeListener(listener); _owner.semanticsOwner.removeListener(listener);
...@@ -1235,7 +1235,7 @@ class PipelineOwner { ...@@ -1235,7 +1235,7 @@ class PipelineOwner {
return; return;
Timeline.startSync('Semantics'); Timeline.startSync('Semantics');
assert(_semanticsOwner != null); assert(_semanticsOwner != null);
assert(() { _debugDoingSemantics = true; return true; }); assert(() { _debugDoingSemantics = true; return true; }());
try { try {
final List<RenderObject> nodesToProcess = _nodesNeedingSemantics.toList() final List<RenderObject> nodesToProcess = _nodesNeedingSemantics.toList()
..sort((RenderObject a, RenderObject b) => a.depth - b.depth); ..sort((RenderObject a, RenderObject b) => a.depth - b.depth);
...@@ -1247,7 +1247,7 @@ class PipelineOwner { ...@@ -1247,7 +1247,7 @@ class PipelineOwner {
_semanticsOwner.sendSemanticsUpdate(); _semanticsOwner.sendSemanticsUpdate();
} finally { } finally {
assert(_nodesNeedingSemantics.isEmpty); assert(_nodesNeedingSemantics.isEmpty);
assert(() { _debugDoingSemantics = false; return true; }); assert(() { _debugDoingSemantics = false; return true; }());
Timeline.finishSync(); Timeline.finishSync();
} }
} }
...@@ -1562,7 +1562,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1562,7 +1562,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
node = node.parent; node = node.parent;
} }
return true; return true;
}); }());
return result; return result;
} }
...@@ -1611,7 +1611,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1611,7 +1611,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
assert(() { assert(() {
result = _needsLayout; result = _needsLayout;
return true; return true;
}); }());
return result; return result;
} }
bool _needsLayout = true; bool _needsLayout = true;
...@@ -1710,7 +1710,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1710,7 +1710,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
if (debugPrintMarkNeedsLayoutStacks) if (debugPrintMarkNeedsLayoutStacks)
debugPrintStack(label: 'markNeedsLayout() called for $this'); debugPrintStack(label: 'markNeedsLayout() called for $this');
return true; return true;
}); }());
owner._nodesNeedingLayout.add(this); owner._nodesNeedingLayout.add(this);
owner.requestVisualUpdate(); owner.requestVisualUpdate();
} }
...@@ -1775,7 +1775,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1775,7 +1775,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
assert(() { assert(() {
_debugCanParentUseSize = false; _debugCanParentUseSize = false;
return true; return true;
}); }());
owner._nodesNeedingLayout.add(this); owner._nodesNeedingLayout.add(this);
} }
...@@ -1793,7 +1793,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1793,7 +1793,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
if (debugPrintLayouts) if (debugPrintLayouts)
debugPrint('Laying out (without resize) $this'); debugPrint('Laying out (without resize) $this');
return true; return true;
}); }());
try { try {
performLayout(); performLayout();
markNeedsSemanticsUpdate(); markNeedsSemanticsUpdate();
...@@ -1805,7 +1805,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1805,7 +1805,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
_debugDoingThisLayout = false; _debugDoingThisLayout = false;
_debugMutationsLocked = false; _debugMutationsLocked = false;
return true; return true;
}); }());
_needsLayout = false; _needsLayout = false;
markNeedsPaint(); markNeedsPaint();
} }
...@@ -1875,7 +1875,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1875,7 +1875,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
assert(() { assert(() {
_debugCanParentUseSize = parentUsesSize; _debugCanParentUseSize = parentUsesSize;
return true; return true;
}); }());
if (!_needsLayout && constraints == _constraints && relayoutBoundary == _relayoutBoundary) { if (!_needsLayout && constraints == _constraints && relayoutBoundary == _relayoutBoundary) {
assert(() { assert(() {
// in case parentUsesSize changed since the last invocation, set size // in case parentUsesSize changed since the last invocation, set size
...@@ -1889,7 +1889,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1889,7 +1889,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
_debugDoingThisLayout = false; _debugDoingThisLayout = false;
_debugDoingThisResize = false; _debugDoingThisResize = false;
return true; return true;
}); }());
return; return;
} }
_constraints = constraints; _constraints = constraints;
...@@ -1901,16 +1901,16 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1901,16 +1901,16 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
if (debugPrintLayouts) if (debugPrintLayouts)
debugPrint('Laying out (${sizedByParent ? "with separate resize" : "with resize allowed"}) $this'); debugPrint('Laying out (${sizedByParent ? "with separate resize" : "with resize allowed"}) $this');
return true; return true;
}); }());
if (sizedByParent) { if (sizedByParent) {
assert(() { _debugDoingThisResize = true; return true; }); assert(() { _debugDoingThisResize = true; return true; }());
try { try {
performResize(); performResize();
assert(() { debugAssertDoesMeetConstraints(); return true; }); assert(() { debugAssertDoesMeetConstraints(); return true; }());
} catch (e, stack) { } catch (e, stack) {
_debugReportException('performResize', e, stack); _debugReportException('performResize', e, stack);
} }
assert(() { _debugDoingThisResize = false; return true; }); assert(() { _debugDoingThisResize = false; return true; }());
} }
RenderObject debugPreviousActiveLayout; RenderObject debugPreviousActiveLayout;
assert(() { assert(() {
...@@ -1918,11 +1918,11 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1918,11 +1918,11 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
debugPreviousActiveLayout = _debugActiveLayout; debugPreviousActiveLayout = _debugActiveLayout;
_debugActiveLayout = this; _debugActiveLayout = this;
return true; return true;
}); }());
try { try {
performLayout(); performLayout();
markNeedsSemanticsUpdate(); markNeedsSemanticsUpdate();
assert(() { debugAssertDoesMeetConstraints(); return true; }); assert(() { debugAssertDoesMeetConstraints(); return true; }());
} catch (e, stack) { } catch (e, stack) {
_debugReportException('performLayout', e, stack); _debugReportException('performLayout', e, stack);
} }
...@@ -1931,7 +1931,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1931,7 +1931,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
_debugDoingThisLayout = false; _debugDoingThisLayout = false;
_debugMutationsLocked = false; _debugMutationsLocked = false;
return true; return true;
}); }());
_needsLayout = false; _needsLayout = false;
markNeedsPaint(); markNeedsPaint();
} }
...@@ -2112,7 +2112,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2112,7 +2112,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
assert(() { assert(() {
result = _layer; result = _layer;
return true; return true;
}); }());
return result; return result;
} }
...@@ -2147,7 +2147,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2147,7 +2147,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
if (parent is RenderObject) if (parent is RenderObject)
return parent._needsCompositing; return parent._needsCompositing;
return true; return true;
}); }());
// parent is fine (or there isn't one), but we are dirty // parent is fine (or there isn't one), but we are dirty
if (owner != null) if (owner != null)
owner._nodesNeedingCompositingBitsUpdate.add(this); owner._nodesNeedingCompositingBitsUpdate.add(this);
...@@ -2199,7 +2199,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2199,7 +2199,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
assert(() { assert(() {
result = _needsPaint; result = _needsPaint;
return true; return true;
}); }());
return result; return result;
} }
bool _needsPaint = true; bool _needsPaint = true;
...@@ -2228,7 +2228,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2228,7 +2228,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
if (debugPrintMarkNeedsPaintStacks) if (debugPrintMarkNeedsPaintStacks)
debugPrintStack(label: 'markNeedsPaint() called for $this'); debugPrintStack(label: 'markNeedsPaint() called for $this');
return true; return true;
}); }());
// If we always have our own layer, then we can just repaint // If we always have our own layer, then we can just repaint
// ourselves without involving any other nodes. // ourselves without involving any other nodes.
assert(_layer != null); assert(_layer != null);
...@@ -2249,7 +2249,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2249,7 +2249,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
if (debugPrintMarkNeedsPaintStacks) if (debugPrintMarkNeedsPaintStacks)
debugPrintStack(label: 'markNeedsPaint() called for $this (root of render tree)'); debugPrintStack(label: 'markNeedsPaint() called for $this (root of render tree)');
return true; return true;
}); }());
// If we're the root of the render tree (probably a RenderView), // If we're the root of the render tree (probably a RenderView),
// then we have to paint ourselves, since nobody else can paint // then we have to paint ourselves, since nobody else can paint
// us. We don't add ourselves to _nodesNeedingPaint in this // us. We don't add ourselves to _nodesNeedingPaint in this
...@@ -2332,7 +2332,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2332,7 +2332,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
); );
} }
return true; return true;
}); }());
// If we still need layout, then that means that we were skipped in the // If we still need layout, then that means that we were skipped in the
// layout phase and therefore don't need painting. We might not know that // layout phase and therefore don't need painting. We might not know that
// yet (that is, our layer might not have been detached yet), because the // yet (that is, our layer might not have been detached yet), because the
...@@ -2357,7 +2357,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2357,7 +2357,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
); );
} }
return true; return true;
}); }());
RenderObject debugLastActivePaint; RenderObject debugLastActivePaint;
assert(() { assert(() {
_debugDoingThisPaint = true; _debugDoingThisPaint = true;
...@@ -2365,7 +2365,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2365,7 +2365,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
_debugActivePaint = this; _debugActivePaint = this;
assert(!isRepaintBoundary || _layer != null); assert(!isRepaintBoundary || _layer != null);
return true; return true;
}); }());
_needsPaint = false; _needsPaint = false;
try { try {
paint(context, offset); paint(context, offset);
...@@ -2379,7 +2379,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2379,7 +2379,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
_debugActivePaint = debugLastActivePaint; _debugActivePaint = debugLastActivePaint;
_debugDoingThisPaint = false; _debugDoingThisPaint = false;
return true; return true;
}); }());
} }
/// The bounds within which this render object will paint. /// The bounds within which this render object will paint.
...@@ -2534,7 +2534,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2534,7 +2534,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
assert(() { assert(() {
result = _semantics; result = _semantics;
return true; return true;
}); }());
return result; return result;
} }
...@@ -2947,7 +2947,7 @@ abstract class RenderObjectWithChildMixin<ChildType extends RenderObject> extend ...@@ -2947,7 +2947,7 @@ abstract class RenderObjectWithChildMixin<ChildType extends RenderObject> extend
); );
} }
return true; return true;
}); }());
return true; return true;
} }
...@@ -3084,7 +3084,7 @@ abstract class ContainerRenderObjectMixin<ChildType extends RenderObject, Parent ...@@ -3084,7 +3084,7 @@ abstract class ContainerRenderObjectMixin<ChildType extends RenderObject, Parent
); );
} }
return true; return true;
}); }());
return true; return true;
} }
......
...@@ -331,7 +331,7 @@ class RenderParagraph extends RenderBox { ...@@ -331,7 +331,7 @@ class RenderParagraph extends RenderBox {
canvas.drawRect(offset & size, paint); canvas.drawRect(offset & size, paint);
} }
return true; return true;
}); }());
if (_hasVisualOverflow) { if (_hasVisualOverflow) {
final Rect bounds = offset & size; final Rect bounds = offset & size;
......
...@@ -272,7 +272,7 @@ class RenderConstrainedBox extends RenderProxyBox { ...@@ -272,7 +272,7 @@ class RenderConstrainedBox extends RenderProxyBox {
context.canvas.drawRect(offset & size, paint); context.canvas.drawRect(offset & size, paint);
} }
return true; return true;
}); }());
} }
@override @override
...@@ -463,7 +463,7 @@ class RenderAspectRatio extends RenderProxyBox { ...@@ -463,7 +463,7 @@ class RenderAspectRatio extends RenderProxyBox {
); );
} }
return true; return true;
}); }());
if (constraints.isTight) if (constraints.isTight)
return constraints.smallest; return constraints.smallest;
...@@ -1043,7 +1043,7 @@ abstract class _RenderCustomClip<T> extends RenderProxyBox { ...@@ -1043,7 +1043,7 @@ abstract class _RenderCustomClip<T> extends RenderProxyBox {
) )
..layout(); ..layout();
return true; return true;
}); }());
} }
} }
...@@ -1093,7 +1093,7 @@ class RenderClipRect extends _RenderCustomClip<Rect> { ...@@ -1093,7 +1093,7 @@ class RenderClipRect extends _RenderCustomClip<Rect> {
_debugText.paint(context.canvas, offset + new Offset(_clip.width / 8.0, -_debugText.text.style.fontSize * 1.1)); _debugText.paint(context.canvas, offset + new Offset(_clip.width / 8.0, -_debugText.text.style.fontSize * 1.1));
} }
return true; return true;
}); }());
} }
} }
...@@ -1164,7 +1164,7 @@ class RenderClipRRect extends _RenderCustomClip<RRect> { ...@@ -1164,7 +1164,7 @@ class RenderClipRRect extends _RenderCustomClip<RRect> {
_debugText.paint(context.canvas, offset + new Offset(_clip.tlRadiusX, -_debugText.text.style.fontSize * 1.1)); _debugText.paint(context.canvas, offset + new Offset(_clip.tlRadiusX, -_debugText.text.style.fontSize * 1.1));
} }
return true; return true;
}); }());
} }
} }
...@@ -1228,7 +1228,7 @@ class RenderClipOval extends _RenderCustomClip<Rect> { ...@@ -1228,7 +1228,7 @@ class RenderClipOval extends _RenderCustomClip<Rect> {
_debugText.paint(context.canvas, offset + new Offset((_clip.width - _debugText.width) / 2.0, -_debugText.text.style.fontSize * 1.1)); _debugText.paint(context.canvas, offset + new Offset((_clip.width - _debugText.width) / 2.0, -_debugText.text.style.fontSize * 1.1));
} }
return true; return true;
}); }());
} }
} }
...@@ -1286,7 +1286,7 @@ class RenderClipPath extends _RenderCustomClip<Path> { ...@@ -1286,7 +1286,7 @@ class RenderClipPath extends _RenderCustomClip<Path> {
_debugText.paint(context.canvas, offset); _debugText.paint(context.canvas, offset);
} }
return true; return true;
}); }());
} }
} }
...@@ -1555,7 +1555,7 @@ class RenderDecoratedBox extends RenderProxyBox { ...@@ -1555,7 +1555,7 @@ class RenderDecoratedBox extends RenderProxyBox {
assert(() { assert(() {
debugSaveCount = context.canvas.getSaveCount(); debugSaveCount = context.canvas.getSaveCount();
return true; return true;
}); }());
_painter.paint(context.canvas, offset, filledConfiguration); _painter.paint(context.canvas, offset, filledConfiguration);
assert(() { assert(() {
if (debugSaveCount != context.canvas.getSaveCount()) { if (debugSaveCount != context.canvas.getSaveCount()) {
...@@ -1571,7 +1571,7 @@ class RenderDecoratedBox extends RenderProxyBox { ...@@ -1571,7 +1571,7 @@ class RenderDecoratedBox extends RenderProxyBox {
); );
} }
return true; return true;
}); }());
if (decoration.isComplex) if (decoration.isComplex)
context.setIsComplexHint(); context.setIsComplexHint();
} }
...@@ -2294,7 +2294,7 @@ class RenderCustomPaint extends RenderProxyBox { ...@@ -2294,7 +2294,7 @@ class RenderCustomPaint extends RenderProxyBox {
void _paintWithPainter(Canvas canvas, Offset offset, CustomPainter painter) { void _paintWithPainter(Canvas canvas, Offset offset, CustomPainter painter) {
int debugPreviousCanvasSaveCount; int debugPreviousCanvasSaveCount;
canvas.save(); canvas.save();
assert(() { debugPreviousCanvasSaveCount = canvas.getSaveCount(); return true; }); assert(() { debugPreviousCanvasSaveCount = canvas.getSaveCount(); return true; }());
if (offset != Offset.zero) if (offset != Offset.zero)
canvas.translate(offset.dx, offset.dy); canvas.translate(offset.dx, offset.dy);
painter.paint(canvas, size); painter.paint(canvas, size);
...@@ -2328,7 +2328,7 @@ class RenderCustomPaint extends RenderProxyBox { ...@@ -2328,7 +2328,7 @@ class RenderCustomPaint extends RenderProxyBox {
); );
} }
return debugNewCanvasSaveCount == debugPreviousCanvasSaveCount; return debugNewCanvasSaveCount == debugPreviousCanvasSaveCount;
}); }());
canvas.restore(); canvas.restore();
} }
...@@ -2513,7 +2513,7 @@ class RenderRepaintBoundary extends RenderProxyBox { ...@@ -2513,7 +2513,7 @@ class RenderRepaintBoundary extends RenderProxyBox {
_debugSymmetricPaintCount = 0; _debugSymmetricPaintCount = 0;
_debugAsymmetricPaintCount = 0; _debugAsymmetricPaintCount = 0;
return true; return true;
}); }());
} }
@override @override
...@@ -2524,7 +2524,7 @@ class RenderRepaintBoundary extends RenderProxyBox { ...@@ -2524,7 +2524,7 @@ class RenderRepaintBoundary extends RenderProxyBox {
else else
_debugAsymmetricPaintCount += 1; _debugAsymmetricPaintCount += 1;
return true; return true;
}); }());
} }
@override @override
...@@ -2557,7 +2557,7 @@ class RenderRepaintBoundary extends RenderProxyBox { ...@@ -2557,7 +2557,7 @@ class RenderRepaintBoundary extends RenderProxyBox {
description.add(new MessageProperty('diagnosis', diagnosis)); description.add(new MessageProperty('diagnosis', diagnosis));
} }
return true; return true;
}); }());
if (inReleaseMode) if (inReleaseMode)
description.add(new DiagnosticsNode.message('(run in checked mode to collect repaint boundary statistics)')); description.add(new DiagnosticsNode.message('(run in checked mode to collect repaint boundary statistics)'));
} }
......
...@@ -467,13 +467,13 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { ...@@ -467,13 +467,13 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
ancestor = ancestor.parent; ancestor = ancestor.parent;
assert(!_newChildren.any((SemanticsNode child) => child == ancestor)); assert(!_newChildren.any((SemanticsNode child) => child == ancestor));
return true; return true;
}); }());
assert(() { assert(() {
final Set<SemanticsNode> seenChildren = new Set<SemanticsNode>(); final Set<SemanticsNode> seenChildren = new Set<SemanticsNode>();
for (SemanticsNode child in _newChildren) for (SemanticsNode child in _newChildren)
assert(seenChildren.add(child)); // check for duplicate adds assert(seenChildren.add(child)); // check for duplicate adds
return true; return true;
}); }());
} }
/// Contains the children in inverse hit test order (i.e. paint order). /// Contains the children in inverse hit test order (i.e. paint order).
......
...@@ -202,7 +202,7 @@ class RenderPadding extends RenderShiftedBox { ...@@ -202,7 +202,7 @@ class RenderPadding extends RenderShiftedBox {
final Rect outerRect = offset & size; final Rect outerRect = offset & size;
debugPaintPadding(context.canvas, outerRect, child != null ? _resolvedPadding.deflateRect(outerRect) : null); debugPaintPadding(context.canvas, outerRect, child != null ? _resolvedPadding.deflateRect(outerRect) : null);
return true; return true;
}); }());
} }
@override @override
...@@ -422,7 +422,7 @@ class RenderPositionedBox extends RenderAligningShiftedBox { ...@@ -422,7 +422,7 @@ class RenderPositionedBox extends RenderAligningShiftedBox {
context.canvas.drawRect(offset & size, paint); context.canvas.drawRect(offset & size, paint);
} }
return true; return true;
}); }());
} }
@override @override
......
...@@ -453,7 +453,7 @@ class SliverConstraints extends Constraints { ...@@ -453,7 +453,7 @@ class SliverConstraints extends Constraints {
verify(remainingPaintExtent >= 0.0, 'The "remainingPaintExtent" is negative.'); verify(remainingPaintExtent >= 0.0, 'The "remainingPaintExtent" is negative.');
verify(isNormalized, 'The constraints are not normalized.'); // should be redundant with earlier checks verify(isNormalized, 'The constraints are not normalized.'); // should be redundant with earlier checks
return true; return true;
}); }());
return true; return true;
} }
...@@ -669,7 +669,7 @@ class SliverGeometry extends Diagnosticable { ...@@ -669,7 +669,7 @@ class SliverGeometry extends Diagnosticable {
verify(hasVisualOverflow != null, 'The "hasVisualOverflow" is null.'); verify(hasVisualOverflow != null, 'The "hasVisualOverflow" is null.');
verify(scrollOffsetCorrection != 0.0, 'The "scrollOffsetCorrection" is zero.'); verify(scrollOffsetCorrection != 0.0, 'The "scrollOffsetCorrection" is zero.');
return true; return true;
}); }());
return true; return true;
} }
...@@ -991,7 +991,7 @@ abstract class RenderSliver extends RenderObject { ...@@ -991,7 +991,7 @@ abstract class RenderSliver extends RenderObject {
'The RenderSliver in question is:\n' 'The RenderSliver in question is:\n'
' $this' ' $this'
); );
}); }());
_geometry = value; _geometry = value;
} }
...@@ -1042,7 +1042,7 @@ abstract class RenderSliver extends RenderObject { ...@@ -1042,7 +1042,7 @@ abstract class RenderSliver extends RenderObject {
); );
} }
return true; return true;
}); }());
} }
@override @override
...@@ -1195,7 +1195,7 @@ abstract class RenderSliver extends RenderObject { ...@@ -1195,7 +1195,7 @@ abstract class RenderSliver extends RenderObject {
double childMainAxisPosition(covariant RenderObject child) { double childMainAxisPosition(covariant RenderObject child) {
assert(() { assert(() {
throw new FlutterError('$runtimeType does not implement childPosition.'); throw new FlutterError('$runtimeType does not implement childPosition.');
}); }());
return 0.0; return 0.0;
} }
...@@ -1232,7 +1232,7 @@ abstract class RenderSliver extends RenderObject { ...@@ -1232,7 +1232,7 @@ abstract class RenderSliver extends RenderObject {
void applyPaintTransform(RenderObject child, Matrix4 transform) { void applyPaintTransform(RenderObject child, Matrix4 transform) {
assert(() { assert(() {
throw new FlutterError('$runtimeType does not implement applyPaintTransform.'); throw new FlutterError('$runtimeType does not implement applyPaintTransform.');
}); }());
} }
/// This returns a [Size] with dimensions relative to the leading edge of the /// This returns a [Size] with dimensions relative to the leading edge of the
...@@ -1291,7 +1291,7 @@ abstract class RenderSliver extends RenderObject { ...@@ -1291,7 +1291,7 @@ abstract class RenderSliver extends RenderObject {
paint paint
); );
return true; return true;
}); }());
} }
@override @override
...@@ -1358,7 +1358,7 @@ abstract class RenderSliver extends RenderObject { ...@@ -1358,7 +1358,7 @@ abstract class RenderSliver extends RenderObject {
} }
} }
return true; return true;
}); }());
} }
// This override exists only to change the type of the second argument. // This override exists only to change the type of the second argument.
......
...@@ -201,7 +201,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver ...@@ -201,7 +201,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
child = childAfter(child); child = childAfter(child);
} }
return true; return true;
}); }());
} }
@override @override
...@@ -567,7 +567,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver ...@@ -567,7 +567,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
child = childAfter(child); child = childAfter(child);
} }
return true; return true;
}); }());
return true; return true;
} }
......
...@@ -302,7 +302,7 @@ class RenderSliverPadding extends RenderSliver with RenderObjectWithChildMixin<R ...@@ -302,7 +302,7 @@ class RenderSliverPadding extends RenderSliver with RenderObjectWithChildMixin<R
debugPaintPadding(context.canvas, outerRect, innerRect); debugPaintPadding(context.canvas, outerRect, innerRect);
} }
return true; return true;
}); }());
} }
@override @override
......
...@@ -138,7 +138,7 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje ...@@ -138,7 +138,7 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje
'The specified maxExtent was: ${maxExtent.toStringAsFixed(1)}\n' 'The specified maxExtent was: ${maxExtent.toStringAsFixed(1)}\n'
'The specified minExtent was: ${minExtent.toStringAsFixed(1)}\n' 'The specified minExtent was: ${minExtent.toStringAsFixed(1)}\n'
); );
}); }());
child?.layout( child?.layout(
constraints.asBoxConstraints(maxExtent: math.max(minExtent, maxExtent - shrinkOffset)), constraints.asBoxConstraints(maxExtent: math.max(minExtent, maxExtent - shrinkOffset)),
parentUsesSize: true, parentUsesSize: true,
......
...@@ -882,7 +882,7 @@ class RenderTable extends RenderBox { ...@@ -882,7 +882,7 @@ class RenderTable extends RenderBox {
} }
// beyond this point, unflexedTableWidth is no longer valid // beyond this point, unflexedTableWidth is no longer valid
assert(() { unflexedTableWidth = null; return true; }); assert(() { unflexedTableWidth = null; return true; }());
// 4. apply the maximum width of the table, shrinking columns as // 4. apply the maximum width of the table, shrinking columns as
// necessary, applying minimum column widths as we go // necessary, applying minimum column widths as we go
......
...@@ -195,7 +195,7 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox> ...@@ -195,7 +195,7 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
if (debugRepaintRainbowEnabled || debugRepaintTextRainbowEnabled) if (debugRepaintRainbowEnabled || debugRepaintTextRainbowEnabled)
debugCurrentRepaintColor = debugCurrentRepaintColor.withHue(debugCurrentRepaintColor.hue + 2.0); debugCurrentRepaintColor = debugCurrentRepaintColor.withHue(debugCurrentRepaintColor.hue + 2.0);
return true; return true;
}); }());
} finally { } finally {
Timeline.finishSync(); Timeline.finishSync();
} }
...@@ -218,7 +218,7 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox> ...@@ -218,7 +218,7 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
assert(() { assert(() {
description.add(new DiagnosticsNode.message('debug mode enabled - ${Platform.operatingSystem}')); description.add(new DiagnosticsNode.message('debug mode enabled - ${Platform.operatingSystem}'));
return true; return true;
}); }());
description.add(new DiagnosticsProperty<Size>('window size', ui.window.physicalSize, tooltip: 'in physical pixels')); description.add(new DiagnosticsProperty<Size>('window size', ui.window.physicalSize, tooltip: 'in physical pixels'));
description.add(new DoubleProperty('device pixel ratio', ui.window.devicePixelRatio, tooltip: 'physical pixels per logical pixel')); description.add(new DoubleProperty('device pixel ratio', ui.window.devicePixelRatio, tooltip: 'physical pixels per logical pixel'));
description.add(new DiagnosticsProperty<ViewConfiguration>('configuration', configuration, tooltip: 'in logical pixels')); description.add(new DiagnosticsProperty<ViewConfiguration>('configuration', configuration, tooltip: 'in logical pixels'));
......
...@@ -201,7 +201,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix ...@@ -201,7 +201,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
); );
} }
return true; return true;
}); }());
return true; return true;
} }
...@@ -296,7 +296,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix ...@@ -296,7 +296,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
), parentUsesSize: true); ), parentUsesSize: true);
final SliverGeometry childLayoutGeometry = child.geometry; final SliverGeometry childLayoutGeometry = child.geometry;
assert(childLayoutGeometry.debugAssertIsValid); assert(childLayoutGeometry.debugAssertIsValid());
// If there is a correction to apply, we'll have to start over. // If there is a correction to apply, we'll have to start over.
if (childLayoutGeometry.scrollOffsetCorrection != null) if (childLayoutGeometry.scrollOffsetCorrection != null)
...@@ -366,7 +366,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix ...@@ -366,7 +366,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
child = childAfter(child); child = childAfter(child);
} }
return true; return true;
}); }());
} }
@override @override
...@@ -848,7 +848,7 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat ...@@ -848,7 +848,7 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat
} }
} }
return true; return true;
}); }());
size = constraints.biggest; size = constraints.biggest;
// We ignore the return value of applyViewportDimension below because we are // We ignore the return value of applyViewportDimension below because we are
// going to go through performLayout next regardless. // going to go through performLayout next regardless.
...@@ -935,7 +935,7 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat ...@@ -935,7 +935,7 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat
); );
} }
return true; return true;
}); }());
} }
double _attemptLayout(double mainAxisExtent, double crossAxisExtent, double correctedOffset) { double _attemptLayout(double mainAxisExtent, double crossAxisExtent, double correctedOffset) {
...@@ -1217,7 +1217,7 @@ class RenderShrinkWrappingViewport extends RenderViewportBase<SliverLogicalConta ...@@ -1217,7 +1217,7 @@ class RenderShrinkWrappingViewport extends RenderViewportBase<SliverLogicalConta
); );
} }
return true; return true;
}); }());
return true; return true;
} }
......
...@@ -73,14 +73,14 @@ class _FrameCallbackEntry { ...@@ -73,14 +73,14 @@ class _FrameCallbackEntry {
); );
} }
return true; return true;
}); }());
debugStack = debugCurrentCallbackStack; debugStack = debugCurrentCallbackStack;
} else { } else {
// TODO(ianh): trim the frames from this library, so that the call to scheduleFrameCallback is the top one // TODO(ianh): trim the frames from this library, so that the call to scheduleFrameCallback is the top one
debugStack = StackTrace.current; debugStack = StackTrace.current;
} }
return true; return true;
}); }());
} }
final FrameCallback callback; final FrameCallback callback;
...@@ -363,7 +363,7 @@ abstract class SchedulerBinding extends BindingBase { ...@@ -363,7 +363,7 @@ abstract class SchedulerBinding extends BindingBase {
)); ));
} }
return true; return true;
}); }());
return true; return true;
} }
...@@ -399,7 +399,7 @@ abstract class SchedulerBinding extends BindingBase { ...@@ -399,7 +399,7 @@ abstract class SchedulerBinding extends BindingBase {
debugPrint('No transient callback is currently executing.'); debugPrint('No transient callback is currently executing.');
} }
return true; return true;
}); }());
} }
final List<FrameCallback> _persistentCallbacks = <FrameCallback>[]; final List<FrameCallback> _persistentCallbacks = <FrameCallback>[];
...@@ -503,7 +503,7 @@ abstract class SchedulerBinding extends BindingBase { ...@@ -503,7 +503,7 @@ abstract class SchedulerBinding extends BindingBase {
if (debugPrintScheduleFrameStacks) if (debugPrintScheduleFrameStacks)
debugPrintStack(label: 'scheduleFrame() called. Current phase is $schedulerPhase.'); debugPrintStack(label: 'scheduleFrame() called. Current phase is $schedulerPhase.');
return true; return true;
}); }());
ui.window.scheduleFrame(); ui.window.scheduleFrame();
_hasScheduledFrame = true; _hasScheduledFrame = true;
} }
...@@ -610,7 +610,7 @@ abstract class SchedulerBinding extends BindingBase { ...@@ -610,7 +610,7 @@ abstract class SchedulerBinding extends BindingBase {
debugPrint(_debugBanner); debugPrint(_debugBanner);
} }
return true; return true;
}); }());
assert(schedulerPhase == SchedulerPhase.idle); assert(schedulerPhase == SchedulerPhase.idle);
_hasScheduledFrame = false; _hasScheduledFrame = false;
...@@ -667,7 +667,7 @@ abstract class SchedulerBinding extends BindingBase { ...@@ -667,7 +667,7 @@ abstract class SchedulerBinding extends BindingBase {
debugPrint('▀' * _debugBanner.length); debugPrint('▀' * _debugBanner.length);
_debugBanner = null; _debugBanner = null;
return true; return true;
}); }());
_currentFrameTimeStamp = null; _currentFrameTimeStamp = null;
} }
...@@ -708,7 +708,7 @@ abstract class SchedulerBinding extends BindingBase { ...@@ -708,7 +708,7 @@ abstract class SchedulerBinding extends BindingBase {
assert(callback != null); assert(callback != null);
assert(_FrameCallbackEntry.debugCurrentCallbackStack == null); assert(_FrameCallbackEntry.debugCurrentCallbackStack == null);
// TODO(ianh): Consider using a Zone instead to track the current callback registration stack // TODO(ianh): Consider using a Zone instead to track the current callback registration stack
assert(() { _FrameCallbackEntry.debugCurrentCallbackStack = callbackStack; return true; }); assert(() { _FrameCallbackEntry.debugCurrentCallbackStack = callbackStack; return true; }());
try { try {
callback(timeStamp); callback(timeStamp);
} catch (exception, exceptionStack) { } catch (exception, exceptionStack) {
...@@ -727,7 +727,7 @@ abstract class SchedulerBinding extends BindingBase { ...@@ -727,7 +727,7 @@ abstract class SchedulerBinding extends BindingBase {
} }
)); ));
} }
assert(() { _FrameCallbackEntry.debugCurrentCallbackStack = null; return true; }); assert(() { _FrameCallbackEntry.debugCurrentCallbackStack = null; return true; }());
} }
} }
......
...@@ -64,6 +64,6 @@ bool debugAssertAllSchedulerVarsUnset(String reason) { ...@@ -64,6 +64,6 @@ bool debugAssertAllSchedulerVarsUnset(String reason) {
throw new FlutterError(reason); throw new FlutterError(reason);
} }
return true; return true;
}); }());
return true; return true;
} }
...@@ -63,7 +63,7 @@ class Ticker { ...@@ -63,7 +63,7 @@ class Ticker {
assert(() { assert(() {
_debugCreationStack = StackTrace.current; _debugCreationStack = StackTrace.current;
return true; return true;
}); }());
} }
TickerFuture _future; TickerFuture _future;
...@@ -140,7 +140,7 @@ class Ticker { ...@@ -140,7 +140,7 @@ class Ticker {
); );
} }
return true; return true;
}); }());
assert(_startTime == null); assert(_startTime == null);
_future = new TickerFuture._(); _future = new TickerFuture._();
if (shouldScheduleTick) if (shouldScheduleTick)
...@@ -290,7 +290,7 @@ class Ticker { ...@@ -290,7 +290,7 @@ class Ticker {
// catch cases of use-after-dispose. // catch cases of use-after-dispose.
_startTime = const Duration(); _startTime = const Duration();
return true; return true;
}); }());
} }
/// An optional label can be provided for debugging purposes. /// An optional label can be provided for debugging purposes.
...@@ -306,7 +306,7 @@ class Ticker { ...@@ -306,7 +306,7 @@ class Ticker {
assert(() { assert(() {
buffer.write(debugLabel ?? ''); buffer.write(debugLabel ?? '');
return true; return true;
}); }());
buffer.write(')'); buffer.write(')');
assert(() { assert(() {
if (debugIncludeStack) { if (debugIncludeStack) {
...@@ -315,7 +315,7 @@ class Ticker { ...@@ -315,7 +315,7 @@ class Ticker {
FlutterError.defaultStackFilter(_debugCreationStack.toString().trimRight().split('\n')).forEach(buffer.writeln); FlutterError.defaultStackFilter(_debugCreationStack.toString().trimRight().split('\n')).forEach(buffer.writeln);
} }
return true; return true;
}); }());
return buffer.toString(); return buffer.toString();
} }
} }
......
...@@ -486,7 +486,7 @@ class _WidgetsAppState extends State<WidgetsApp> implements WidgetsBindingObserv ...@@ -486,7 +486,7 @@ class _WidgetsAppState extends State<WidgetsApp> implements WidgetsBindingObserv
); );
} }
return true; return true;
}); }());
return new MediaQuery( return new MediaQuery(
data: new MediaQueryData.fromWindow(ui.window), data: new MediaQueryData.fromWindow(ui.window),
......
...@@ -113,7 +113,7 @@ class _AutomaticKeepAliveState extends State<AutomaticKeepAlive> { ...@@ -113,7 +113,7 @@ class _AutomaticKeepAliveState extends State<AutomaticKeepAlive> {
); );
} }
return true; return true;
}); }());
_handles.remove(handle); _handles.remove(handle);
if (_handles.isEmpty) { if (_handles.isEmpty) {
if (SchedulerBinding.instance.schedulerPhase.index < SchedulerPhase.persistentCallbacks.index) { if (SchedulerBinding.instance.schedulerPhase.index < SchedulerPhase.persistentCallbacks.index) {
......
...@@ -343,7 +343,7 @@ class CheckedModeBanner extends StatelessWidget { ...@@ -343,7 +343,7 @@ class CheckedModeBanner extends StatelessWidget {
location: BannerLocation.topEnd, location: BannerLocation.topEnd,
); );
return true; return true;
}); }());
return result; return result;
} }
...@@ -354,7 +354,7 @@ class CheckedModeBanner extends StatelessWidget { ...@@ -354,7 +354,7 @@ class CheckedModeBanner extends StatelessWidget {
assert(() { assert(() {
message = '"SLOW MODE"'; message = '"SLOW MODE"';
return true; return true;
}); }());
description.add(new DiagnosticsNode.message(message)); description.add(new DiagnosticsNode.message(message));
} }
} }
...@@ -441,7 +441,7 @@ abstract class WidgetsBinding extends BindingBase with GestureBinding, RendererB ...@@ -441,7 +441,7 @@ abstract class WidgetsBinding extends BindingBase with GestureBinding, RendererB
); );
} }
return true; return true;
}); }());
ensureVisualUpdate(); ensureVisualUpdate();
} }
...@@ -524,7 +524,7 @@ abstract class WidgetsBinding extends BindingBase with GestureBinding, RendererB ...@@ -524,7 +524,7 @@ abstract class WidgetsBinding extends BindingBase with GestureBinding, RendererB
assert(() { assert(() {
debugBuildingDirtyElements = true; debugBuildingDirtyElements = true;
return true; return true;
}); }());
try { try {
if (renderViewElement != null) if (renderViewElement != null)
buildOwner.buildScope(renderViewElement); buildOwner.buildScope(renderViewElement);
...@@ -534,7 +534,7 @@ abstract class WidgetsBinding extends BindingBase with GestureBinding, RendererB ...@@ -534,7 +534,7 @@ abstract class WidgetsBinding extends BindingBase with GestureBinding, RendererB
assert(() { assert(() {
debugBuildingDirtyElements = false; debugBuildingDirtyElements = false;
return true; return true;
}); }());
} }
// TODO(ianh): Following code should not be included in release mode, only profile and debug modes. // TODO(ianh): Following code should not be included in release mode, only profile and debug modes.
// See https://github.com/dart-lang/sdk/issues/27192 // See https://github.com/dart-lang/sdk/issues/27192
...@@ -613,7 +613,7 @@ void runApp(Widget app) { ...@@ -613,7 +613,7 @@ void runApp(Widget app) {
void debugDumpApp() { void debugDumpApp() {
assert(WidgetsBinding.instance != null); assert(WidgetsBinding.instance != null);
String mode = 'RELEASE MODE'; String mode = 'RELEASE MODE';
assert(() { mode = 'CHECKED MODE'; return true; }); assert(() { mode = 'CHECKED MODE'; return true; }());
debugPrint('${WidgetsBinding.instance.runtimeType} - $mode'); debugPrint('${WidgetsBinding.instance.runtimeType} - $mode');
if (WidgetsBinding.instance.renderViewElement != null) { if (WidgetsBinding.instance.renderViewElement != null) {
debugPrint(WidgetsBinding.instance.renderViewElement.toStringDeep()); debugPrint(WidgetsBinding.instance.renderViewElement.toStringDeep());
......
...@@ -113,7 +113,7 @@ bool debugChildrenHaveDuplicateKeys(Widget parent, Iterable<Widget> children) { ...@@ -113,7 +113,7 @@ bool debugChildrenHaveDuplicateKeys(Widget parent, Iterable<Widget> children) {
); );
} }
return true; return true;
}); }());
return false; return false;
} }
...@@ -135,7 +135,7 @@ bool debugItemsHaveDuplicateKeys(Iterable<Widget> items) { ...@@ -135,7 +135,7 @@ bool debugItemsHaveDuplicateKeys(Iterable<Widget> items) {
if (nonUniqueKey != null) if (nonUniqueKey != null)
throw new FlutterError('Duplicate key found: $nonUniqueKey.'); throw new FlutterError('Duplicate key found: $nonUniqueKey.');
return true; return true;
}); }());
return false; return false;
} }
...@@ -165,7 +165,7 @@ bool debugCheckHasTable(BuildContext context) { ...@@ -165,7 +165,7 @@ bool debugCheckHasTable(BuildContext context) {
); );
} }
return true; return true;
}); }());
return true; return true;
} }
...@@ -198,7 +198,7 @@ bool debugCheckHasMediaQuery(BuildContext context) { ...@@ -198,7 +198,7 @@ bool debugCheckHasMediaQuery(BuildContext context) {
); );
} }
return true; return true;
}); }());
return true; return true;
} }
...@@ -220,7 +220,7 @@ void debugWidgetBuilderValue(Widget widget, Widget built) { ...@@ -220,7 +220,7 @@ void debugWidgetBuilderValue(Widget widget, Widget built) {
); );
} }
return true; return true;
}); }());
} }
/// Returns true if none of the widget library debug variables have been changed. /// Returns true if none of the widget library debug variables have been changed.
...@@ -241,6 +241,6 @@ bool debugAssertAllWidgetVarsUnset(String reason) { ...@@ -241,6 +241,6 @@ bool debugAssertAllWidgetVarsUnset(String reason) {
throw new FlutterError(reason); throw new FlutterError(reason);
} }
return true; return true;
}); }());
return true; return true;
} }
...@@ -388,7 +388,7 @@ class _DismissibleState extends State<Dismissible> with TickerProviderStateMixin ...@@ -388,7 +388,7 @@ class _DismissibleState extends State<Dismissible> with TickerProviderStateMixin
); );
} }
return true; return true;
}); }());
return new SizeTransition( return new SizeTransition(
sizeFactor: _resizeAnimation, sizeFactor: _resizeAnimation,
......
...@@ -158,7 +158,7 @@ class FocusScopeNode extends Object with DiagnosticableTreeMixin { ...@@ -158,7 +158,7 @@ class FocusScopeNode extends Object with DiagnosticableTreeMixin {
node = node._parent; node = node._parent;
assert(node != child); // indicates we are about to create a cycle assert(node != child); // indicates we are about to create a cycle
return true; return true;
}); }());
child._parent = this; child._parent = this;
child._nextSibling = _firstChild; child._nextSibling = _firstChild;
if (_firstChild != null) if (_firstChild != null)
......
...@@ -197,7 +197,7 @@ abstract class GlobalKey<T extends State<StatefulWidget>> extends Key { ...@@ -197,7 +197,7 @@ abstract class GlobalKey<T extends State<StatefulWidget>> extends Key {
_debugIllFatedElements.add(_registry[this]); _debugIllFatedElements.add(_registry[this]);
} }
return true; return true;
}); }());
_registry[this] = element; _registry[this] = element;
} }
...@@ -209,7 +209,7 @@ abstract class GlobalKey<T extends State<StatefulWidget>> extends Key { ...@@ -209,7 +209,7 @@ abstract class GlobalKey<T extends State<StatefulWidget>> extends Key {
assert(element.widget.runtimeType != _registry[this].widget.runtimeType); assert(element.widget.runtimeType != _registry[this].widget.runtimeType);
} }
return true; return true;
}); }());
if (_registry[this] == element) { if (_registry[this] == element) {
_registry.remove(this); _registry.remove(this);
_removedKeys.add(this); _removedKeys.add(this);
...@@ -246,7 +246,7 @@ abstract class GlobalKey<T extends State<StatefulWidget>> extends Key { ...@@ -246,7 +246,7 @@ abstract class GlobalKey<T extends State<StatefulWidget>> extends Key {
} }
_debugReservations[this] = parent; _debugReservations[this] = parent;
return true; return true;
}); }());
} }
static void _debugVerifyIllFatedPopulation() { static void _debugVerifyIllFatedPopulation() {
...@@ -280,7 +280,7 @@ abstract class GlobalKey<T extends State<StatefulWidget>> extends Key { ...@@ -280,7 +280,7 @@ abstract class GlobalKey<T extends State<StatefulWidget>> extends Key {
throw new FlutterError(buffer.toString()); throw new FlutterError(buffer.toString());
} }
return true; return true;
}); }());
} }
Element get _currentElement => _registry[this]; Element get _currentElement => _registry[this];
...@@ -1158,7 +1158,7 @@ abstract class State<T extends StatefulWidget> extends Diagnosticable { ...@@ -1158,7 +1158,7 @@ abstract class State<T extends StatefulWidget> extends Diagnosticable {
); );
} }
return true; return true;
}); }());
final dynamic result = fn() as dynamic; final dynamic result = fn() as dynamic;
assert(() { assert(() {
if (result is Future) { if (result is Future) {
...@@ -1174,7 +1174,7 @@ abstract class State<T extends StatefulWidget> extends Diagnosticable { ...@@ -1174,7 +1174,7 @@ abstract class State<T extends StatefulWidget> extends Diagnosticable {
// We ignore other types of return values so that you can do things like: // We ignore other types of return values so that you can do things like:
// setState(() => x = 3); // setState(() => x = 3);
return true; return true;
}); }());
_element.markNeedsBuild(); _element.markNeedsBuild();
} }
...@@ -1230,7 +1230,7 @@ abstract class State<T extends StatefulWidget> extends Diagnosticable { ...@@ -1230,7 +1230,7 @@ abstract class State<T extends StatefulWidget> extends Diagnosticable {
@mustCallSuper @mustCallSuper
void dispose() { void dispose() {
assert(_debugLifecycleState == _StateLifecycle.ready); assert(_debugLifecycleState == _StateLifecycle.ready);
assert(() { _debugLifecycleState = _StateLifecycle.defunct; return true; }); assert(() { _debugLifecycleState = _StateLifecycle.defunct; return true; }());
} }
/// Describes the part of the user interface represented by this widget. /// Describes the part of the user interface represented by this widget.
...@@ -1374,7 +1374,7 @@ abstract class State<T extends StatefulWidget> extends Diagnosticable { ...@@ -1374,7 +1374,7 @@ abstract class State<T extends StatefulWidget> extends Diagnosticable {
assert(() { assert(() {
description.add(new EnumProperty<_StateLifecycle>('lifecycle state', _debugLifecycleState, defaultValue: _StateLifecycle.ready)); description.add(new EnumProperty<_StateLifecycle>('lifecycle state', _debugLifecycleState, defaultValue: _StateLifecycle.ready));
return true; return true;
}); }());
description.add(new ObjectFlagProperty<T>('_widget', _widget, ifNull: 'no widget')); description.add(new ObjectFlagProperty<T>('_widget', _widget, ifNull: 'no widget'));
description.add(new ObjectFlagProperty<StatefulElement>('_element', _element, ifNull: 'not mounted')); description.add(new ObjectFlagProperty<StatefulElement>('_element', _element, ifNull: 'not mounted'));
} }
...@@ -1737,7 +1737,7 @@ class _InactiveElements { ...@@ -1737,7 +1737,7 @@ class _InactiveElements {
debugPrint('Discarding $element from inactive elements list.'); debugPrint('Discarding $element from inactive elements list.');
} }
return true; return true;
}); }());
element.visitChildren((Element child) { element.visitChildren((Element child) {
assert(child._parent == element); assert(child._parent == element);
_unmount(child); _unmount(child);
...@@ -1764,7 +1764,7 @@ class _InactiveElements { ...@@ -1764,7 +1764,7 @@ class _InactiveElements {
element.deactivate(); element.deactivate();
assert(element._debugLifecycleState == _ElementLifecycle.inactive); assert(element._debugLifecycleState == _ElementLifecycle.inactive);
element.visitChildren(_deactivateRecursively); element.visitChildren(_deactivateRecursively);
assert(() { element.debugDeactivated(); return true; }); assert(() { element.debugDeactivated(); return true; }());
} }
void add(Element element) { void add(Element element) {
...@@ -1789,7 +1789,7 @@ class _InactiveElements { ...@@ -1789,7 +1789,7 @@ class _InactiveElements {
assert(() { assert(() {
result = _elements.contains(element); result = _elements.contains(element);
return true; return true;
}); }());
return result; return result;
} }
} }
...@@ -2128,7 +2128,7 @@ class BuildOwner { ...@@ -2128,7 +2128,7 @@ class BuildOwner {
); );
} }
return true; return true;
}); }());
if (element._inDirtyList) { if (element._inDirtyList) {
assert(() { assert(() {
if (debugPrintScheduleBuildForStacks) if (debugPrintScheduleBuildForStacks)
...@@ -2141,7 +2141,7 @@ class BuildOwner { ...@@ -2141,7 +2141,7 @@ class BuildOwner {
); );
} }
return true; return true;
}); }());
_dirtyElementsNeedsResorting = true; _dirtyElementsNeedsResorting = true;
return; return;
} }
...@@ -2155,7 +2155,7 @@ class BuildOwner { ...@@ -2155,7 +2155,7 @@ class BuildOwner {
if (debugPrintScheduleBuildForStacks) if (debugPrintScheduleBuildForStacks)
debugPrint('...dirty list is now: $_dirtyElements'); debugPrint('...dirty list is now: $_dirtyElements');
return true; return true;
}); }());
} }
int _debugStateLockLevel = 0; int _debugStateLockLevel = 0;
...@@ -2174,14 +2174,14 @@ class BuildOwner { ...@@ -2174,14 +2174,14 @@ class BuildOwner {
assert(() { assert(() {
_debugStateLockLevel += 1; _debugStateLockLevel += 1;
return true; return true;
}); }());
try { try {
callback(); callback();
} finally { } finally {
assert(() { assert(() {
_debugStateLockLevel -= 1; _debugStateLockLevel -= 1;
return true; return true;
}); }());
} }
assert(_debugStateLockLevel >= 0); assert(_debugStateLockLevel >= 0);
} }
...@@ -2223,7 +2223,7 @@ class BuildOwner { ...@@ -2223,7 +2223,7 @@ class BuildOwner {
_debugStateLockLevel += 1; _debugStateLockLevel += 1;
_debugBuilding = true; _debugBuilding = true;
return true; return true;
}); }());
Timeline.startSync('Build', arguments: timelineWhitelistArguments); Timeline.startSync('Build', arguments: timelineWhitelistArguments);
try { try {
_scheduledFlushDirtyElements = true; _scheduledFlushDirtyElements = true;
...@@ -2235,7 +2235,7 @@ class BuildOwner { ...@@ -2235,7 +2235,7 @@ class BuildOwner {
debugPreviousBuildTarget = _debugCurrentBuildTarget; debugPreviousBuildTarget = _debugCurrentBuildTarget;
_debugCurrentBuildTarget = context; _debugCurrentBuildTarget = context;
return true; return true;
}); }());
_dirtyElementsNeedsResorting = false; _dirtyElementsNeedsResorting = false;
try { try {
callback(); callback();
...@@ -2246,7 +2246,7 @@ class BuildOwner { ...@@ -2246,7 +2246,7 @@ class BuildOwner {
_debugCurrentBuildTarget = debugPreviousBuildTarget; _debugCurrentBuildTarget = debugPreviousBuildTarget;
_debugElementWasRebuilt(context); _debugElementWasRebuilt(context);
return true; return true;
}); }());
} }
} }
_dirtyElements.sort(Element._sort); _dirtyElements.sort(Element._sort);
...@@ -2295,7 +2295,7 @@ class BuildOwner { ...@@ -2295,7 +2295,7 @@ class BuildOwner {
); );
} }
return true; return true;
}); }());
} finally { } finally {
for (Element element in _dirtyElements) { for (Element element in _dirtyElements) {
assert(element._inDirtyList); assert(element._inDirtyList);
...@@ -2312,7 +2312,7 @@ class BuildOwner { ...@@ -2312,7 +2312,7 @@ class BuildOwner {
if (debugPrintBuildScope) if (debugPrintBuildScope)
debugPrint('buildScope finished'); debugPrint('buildScope finished');
return true; return true;
}); }());
} }
assert(_debugStateLockLevel >= 0); assert(_debugStateLockLevel >= 0);
} }
...@@ -2423,7 +2423,7 @@ class BuildOwner { ...@@ -2423,7 +2423,7 @@ class BuildOwner {
_debugElementsThatWillNeedToBeRebuiltDueToGlobalKeyShenanigans?.clear(); _debugElementsThatWillNeedToBeRebuiltDueToGlobalKeyShenanigans?.clear();
} }
return true; return true;
}); }());
} catch (e, stack) { } catch (e, stack) {
_debugReportException('while finalizing the widget tree', e, stack); _debugReportException('while finalizing the widget tree', e, stack);
} finally { } finally {
...@@ -2631,7 +2631,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2631,7 +2631,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
'so the children might not be constructed yet, or might be old children ' 'so the children might not be constructed yet, or might be old children '
'that are going to be replaced.' 'that are going to be replaced.'
); );
}); }());
visitChildren(visitor); visitChildren(visitor);
} }
...@@ -2674,7 +2674,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2674,7 +2674,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
key._debugReserveFor(this); key._debugReserveFor(this);
} }
return true; return true;
}); }());
if (newWidget == null) { if (newWidget == null) {
if (child != null) if (child != null)
deactivateChild(child); deactivateChild(child);
...@@ -2694,7 +2694,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2694,7 +2694,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
assert(() { assert(() {
child.owner._debugElementWasRebuilt(child); child.owner._debugElementWasRebuilt(child);
return true; return true;
}); }());
return child; return child;
} }
deactivateChild(child); deactivateChild(child);
...@@ -2732,7 +2732,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2732,7 +2732,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
key._register(this); key._register(this);
} }
_updateInheritance(); _updateInheritance();
assert(() { _debugLifecycleState = _ElementLifecycle.active; return true; }); assert(() { _debugLifecycleState = _ElementLifecycle.active; return true; }());
} }
/// Change the widget used to configure this element. /// Change the widget used to configure this element.
...@@ -2838,7 +2838,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2838,7 +2838,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
if (debugPrintGlobalKeyedWidgetLifecycle) if (debugPrintGlobalKeyedWidgetLifecycle)
debugPrint('Attempting to take $element from ${element._parent ?? "inactive elements list"} to put in $this.'); debugPrint('Attempting to take $element from ${element._parent ?? "inactive elements list"} to put in $this.');
return true; return true;
}); }());
final Element parent = element._parent; final Element parent = element._parent;
if (parent != null) { if (parent != null) {
assert(() { assert(() {
...@@ -2857,7 +2857,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2857,7 +2857,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
key, key,
); );
return true; return true;
}); }());
parent.forgetChild(element); parent.forgetChild(element);
parent.deactivateChild(element); parent.deactivateChild(element);
} }
...@@ -2888,7 +2888,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2888,7 +2888,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
final Element newChild = _retakeInactiveElement(key, newWidget); final Element newChild = _retakeInactiveElement(key, newWidget);
if (newChild != null) { if (newChild != null) {
assert(newChild._parent == null); assert(newChild._parent == null);
assert(() { _debugCheckForCycles(newChild); return true; }); assert(() { _debugCheckForCycles(newChild); return true; }());
newChild._activateWithParent(this, newSlot); newChild._activateWithParent(this, newSlot);
final Element updatedChild = updateChild(newChild, newWidget, newSlot); final Element updatedChild = updateChild(newChild, newWidget, newSlot);
assert(newChild == updatedChild); assert(newChild == updatedChild);
...@@ -2896,7 +2896,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2896,7 +2896,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
} }
} }
final Element newChild = newWidget.createElement(); final Element newChild = newWidget.createElement();
assert(() { _debugCheckForCycles(newChild); return true; }); assert(() { _debugCheckForCycles(newChild); return true; }());
newChild.mount(this, newSlot); newChild.mount(this, newSlot);
assert(newChild._debugLifecycleState == _ElementLifecycle.active); assert(newChild._debugLifecycleState == _ElementLifecycle.active);
return newChild; return newChild;
...@@ -2910,7 +2910,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2910,7 +2910,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
node = node._parent; node = node._parent;
assert(node != newChild); // indicates we are about to create a cycle assert(node != newChild); // indicates we are about to create a cycle
return true; return true;
}); }());
} }
/// Move the given element to the list of inactive elements and detach its /// Move the given element to the list of inactive elements and detach its
...@@ -2940,7 +2940,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2940,7 +2940,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
debugPrint('Deactivated $child (keyed child of $this)'); debugPrint('Deactivated $child (keyed child of $this)');
} }
return true; return true;
}); }());
} }
/// Remove the given child from the element's child list, in preparation for /// Remove the given child from the element's child list, in preparation for
...@@ -2961,7 +2961,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2961,7 +2961,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
if (debugPrintGlobalKeyedWidgetLifecycle) if (debugPrintGlobalKeyedWidgetLifecycle)
debugPrint('Reactivating $this (now child of $_parent).'); debugPrint('Reactivating $this (now child of $_parent).');
return true; return true;
}); }());
_updateDepth(_parent.depth); _updateDepth(_parent.depth);
_activateRecursively(this); _activateRecursively(this);
attachRenderObject(newSlot); attachRenderObject(newSlot);
...@@ -2997,7 +2997,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -2997,7 +2997,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
_dependencies?.clear(); _dependencies?.clear();
_hadUnsatisfiedDependencies = false; _hadUnsatisfiedDependencies = false;
_updateInheritance(); _updateInheritance();
assert(() { _debugLifecycleState = _ElementLifecycle.active; return true; }); assert(() { _debugLifecycleState = _ElementLifecycle.active; return true; }());
if (_dirty) if (_dirty)
owner.scheduleBuildFor(this); owner.scheduleBuildFor(this);
if (hadDependencies) if (hadDependencies)
...@@ -3034,7 +3034,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3034,7 +3034,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
} }
_inheritedWidgets = null; _inheritedWidgets = null;
_active = false; _active = false;
assert(() { _debugLifecycleState = _ElementLifecycle.inactive; return true; }); assert(() { _debugLifecycleState = _ElementLifecycle.inactive; return true; }());
} }
/// Called, in debug mode, after children have been deactivated (see [deactivate]). /// Called, in debug mode, after children have been deactivated (see [deactivate]).
...@@ -3066,7 +3066,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3066,7 +3066,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
final GlobalKey key = widget.key; final GlobalKey key = widget.key;
key._unregister(this); key._unregister(this);
} }
assert(() { _debugLifecycleState = _ElementLifecycle.defunct; return true; }); assert(() { _debugLifecycleState = _ElementLifecycle.defunct; return true; }());
} }
@override @override
...@@ -3105,7 +3105,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3105,7 +3105,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
); );
} }
return true; return true;
}); }());
final RenderObject renderObject = findRenderObject(); final RenderObject renderObject = findRenderObject();
assert(() { assert(() {
if (renderObject == null) { if (renderObject == null) {
...@@ -3180,7 +3180,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3180,7 +3180,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
); );
} }
return true; return true;
}); }());
if (renderObject is RenderBox) if (renderObject is RenderBox)
return renderObject.size; return renderObject.size;
return null; return null;
...@@ -3202,13 +3202,13 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3202,13 +3202,13 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
); );
} }
return true; return true;
}); }());
return true; return true;
} }
@override @override
InheritedWidget inheritFromWidgetOfExactType(Type targetType) { InheritedWidget inheritFromWidgetOfExactType(Type targetType) {
assert(_debugCheckStateIsActiveForAncestorLoopkup); assert(_debugCheckStateIsActiveForAncestorLoopkup());
final InheritedElement ancestor = _inheritedWidgets == null ? null : _inheritedWidgets[targetType]; final InheritedElement ancestor = _inheritedWidgets == null ? null : _inheritedWidgets[targetType];
if (ancestor != null) { if (ancestor != null) {
assert(ancestor is InheritedElement); assert(ancestor is InheritedElement);
...@@ -3223,7 +3223,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3223,7 +3223,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
@override @override
InheritedElement ancestorInheritedElementForWidgetOfExactType(Type targetType) { InheritedElement ancestorInheritedElementForWidgetOfExactType(Type targetType) {
assert(_debugCheckStateIsActiveForAncestorLoopkup); assert(_debugCheckStateIsActiveForAncestorLoopkup());
final InheritedElement ancestor = _inheritedWidgets == null ? null : _inheritedWidgets[targetType]; final InheritedElement ancestor = _inheritedWidgets == null ? null : _inheritedWidgets[targetType];
return ancestor; return ancestor;
} }
...@@ -3235,7 +3235,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3235,7 +3235,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
@override @override
Widget ancestorWidgetOfExactType(Type targetType) { Widget ancestorWidgetOfExactType(Type targetType) {
assert(_debugCheckStateIsActiveForAncestorLoopkup); assert(_debugCheckStateIsActiveForAncestorLoopkup());
Element ancestor = _parent; Element ancestor = _parent;
while (ancestor != null && ancestor.widget.runtimeType != targetType) while (ancestor != null && ancestor.widget.runtimeType != targetType)
ancestor = ancestor._parent; ancestor = ancestor._parent;
...@@ -3244,7 +3244,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3244,7 +3244,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
@override @override
State ancestorStateOfType(TypeMatcher matcher) { State ancestorStateOfType(TypeMatcher matcher) {
assert(_debugCheckStateIsActiveForAncestorLoopkup); assert(_debugCheckStateIsActiveForAncestorLoopkup());
Element ancestor = _parent; Element ancestor = _parent;
while (ancestor != null) { while (ancestor != null) {
if (ancestor is StatefulElement && matcher.check(ancestor.state)) if (ancestor is StatefulElement && matcher.check(ancestor.state))
...@@ -3257,7 +3257,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3257,7 +3257,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
@override @override
RenderObject ancestorRenderObjectOfType(TypeMatcher matcher) { RenderObject ancestorRenderObjectOfType(TypeMatcher matcher) {
assert(_debugCheckStateIsActiveForAncestorLoopkup); assert(_debugCheckStateIsActiveForAncestorLoopkup());
Element ancestor = _parent; Element ancestor = _parent;
while (ancestor != null) { while (ancestor != null) {
if (ancestor is RenderObjectElement && matcher.check(ancestor.renderObject)) if (ancestor is RenderObjectElement && matcher.check(ancestor.renderObject))
...@@ -3270,7 +3270,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3270,7 +3270,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
@override @override
void visitAncestorElements(bool visitor(Element element)) { void visitAncestorElements(bool visitor(Element element)) {
assert(_debugCheckStateIsActiveForAncestorLoopkup); assert(_debugCheckStateIsActiveForAncestorLoopkup());
Element ancestor = _parent; Element ancestor = _parent;
while (ancestor != null && visitor(ancestor)) while (ancestor != null && visitor(ancestor))
ancestor = ancestor._parent; ancestor = ancestor._parent;
...@@ -3421,7 +3421,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3421,7 +3421,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
); );
} }
return true; return true;
}); }());
if (dirty) if (dirty)
return; return;
_dirty = true; _dirty = true;
...@@ -3445,7 +3445,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3445,7 +3445,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
} }
} }
return true; return true;
}); }());
assert(_debugLifecycleState == _ElementLifecycle.active); assert(_debugLifecycleState == _ElementLifecycle.active);
assert(owner._debugStateLocked); assert(owner._debugStateLocked);
Element debugPreviousBuildTarget; Element debugPreviousBuildTarget;
...@@ -3453,13 +3453,13 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3453,13 +3453,13 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
debugPreviousBuildTarget = owner._debugCurrentBuildTarget; debugPreviousBuildTarget = owner._debugCurrentBuildTarget;
owner._debugCurrentBuildTarget = this; owner._debugCurrentBuildTarget = this;
return true; return true;
}); }());
performRebuild(); performRebuild();
assert(() { assert(() {
assert(owner._debugCurrentBuildTarget == this); assert(owner._debugCurrentBuildTarget == this);
owner._debugCurrentBuildTarget = debugPreviousBuildTarget; owner._debugCurrentBuildTarget = debugPreviousBuildTarget;
return true; return true;
}); }());
assert(!_dirty); assert(!_dirty);
} }
...@@ -3548,7 +3548,7 @@ abstract class ComponentElement extends Element { ...@@ -3548,7 +3548,7 @@ abstract class ComponentElement extends Element {
if (debugProfileBuildsEnabled) if (debugProfileBuildsEnabled)
Timeline.startSync('${widget.runtimeType}'); Timeline.startSync('${widget.runtimeType}');
return true; return true;
}); }());
assert(_debugSetAllowIgnoredCallsToMarkNeedsBuild(true)); assert(_debugSetAllowIgnoredCallsToMarkNeedsBuild(true));
Widget built; Widget built;
...@@ -3577,7 +3577,7 @@ abstract class ComponentElement extends Element { ...@@ -3577,7 +3577,7 @@ abstract class ComponentElement extends Element {
if (debugProfileBuildsEnabled) if (debugProfileBuildsEnabled)
Timeline.finishSync(); Timeline.finishSync();
return true; return true;
}); }());
} }
/// Subclasses should override this function to actually call the appropriate /// Subclasses should override this function to actually call the appropriate
...@@ -3634,7 +3634,7 @@ class StatefulElement extends ComponentElement { ...@@ -3634,7 +3634,7 @@ class StatefulElement extends ComponentElement {
); );
} }
return true; return true;
}); }());
assert(_state._element == null); assert(_state._element == null);
_state._element = this; _state._element = this;
assert(_state._widget == null); assert(_state._widget == null);
...@@ -3668,9 +3668,9 @@ class StatefulElement extends ComponentElement { ...@@ -3668,9 +3668,9 @@ class StatefulElement extends ComponentElement {
} finally { } finally {
_debugSetAllowIgnoredCallsToMarkNeedsBuild(false); _debugSetAllowIgnoredCallsToMarkNeedsBuild(false);
} }
assert(() { _state._debugLifecycleState = _StateLifecycle.initialized; return true; }); assert(() { _state._debugLifecycleState = _StateLifecycle.initialized; return true; }());
_state.didChangeDependencies(); _state.didChangeDependencies();
assert(() { _state._debugLifecycleState = _StateLifecycle.ready; return true; }); assert(() { _state._debugLifecycleState = _StateLifecycle.ready; return true; }());
super._firstBuild(); super._firstBuild();
} }
...@@ -3721,7 +3721,7 @@ class StatefulElement extends ComponentElement { ...@@ -3721,7 +3721,7 @@ class StatefulElement extends ComponentElement {
'dispose() implementations must always call their superclass dispose() method, to ensure ' 'dispose() implementations must always call their superclass dispose() method, to ensure '
'that all the resources used by the widget are fully released.' 'that all the resources used by the widget are fully released.'
); );
}); }());
_state._element = null; _state._element = null;
_state = null; _state = null;
} }
...@@ -3763,7 +3763,7 @@ class StatefulElement extends ComponentElement { ...@@ -3763,7 +3763,7 @@ class StatefulElement extends ComponentElement {
); );
} }
return true; return true;
}); }());
return super.inheritFromWidgetOfExactType(targetType); return super.inheritFromWidgetOfExactType(targetType);
} }
...@@ -3845,7 +3845,7 @@ class ParentDataElement<T extends RenderObjectWidget> extends ProxyElement { ...@@ -3845,7 +3845,7 @@ class ParentDataElement<T extends RenderObjectWidget> extends ProxyElement {
badAncestors: badAncestors badAncestors: badAncestors
) )
); );
}); }());
super.mount(parent, slot); super.mount(parent, slot);
} }
...@@ -3932,7 +3932,7 @@ class InheritedElement extends ProxyElement { ...@@ -3932,7 +3932,7 @@ class InheritedElement extends ProxyElement {
assert(() { assert(() {
assert(_dependents.isEmpty); assert(_dependents.isEmpty);
return true; return true;
}); }());
super.debugDeactivated(); super.debugDeactivated();
} }
...@@ -3959,7 +3959,7 @@ class InheritedElement extends ProxyElement { ...@@ -3959,7 +3959,7 @@ class InheritedElement extends ProxyElement {
while (ancestor != this && ancestor != null) while (ancestor != this && ancestor != null)
ancestor = ancestor._parent; ancestor = ancestor._parent;
return ancestor == this; return ancestor == this;
}); }());
// check that it really deepends on us // check that it really deepends on us
assert(dependent._dependencies.contains(this)); assert(dependent._dependencies.contains(this));
dependent.didChangeDependencies(); dependent.didChangeDependencies();
...@@ -4168,7 +4168,7 @@ abstract class RenderObjectElement extends Element { ...@@ -4168,7 +4168,7 @@ abstract class RenderObjectElement extends Element {
void mount(Element parent, dynamic newSlot) { void mount(Element parent, dynamic newSlot) {
super.mount(parent, newSlot); super.mount(parent, newSlot);
_renderObject = widget.createRenderObject(this); _renderObject = widget.createRenderObject(this);
assert(() { _debugUpdateRenderObjectOwner(); return true; }); assert(() { _debugUpdateRenderObjectOwner(); return true; }());
assert(_slot == newSlot); assert(_slot == newSlot);
attachRenderObject(newSlot); attachRenderObject(newSlot);
_dirty = false; _dirty = false;
...@@ -4178,7 +4178,7 @@ abstract class RenderObjectElement extends Element { ...@@ -4178,7 +4178,7 @@ abstract class RenderObjectElement extends Element {
void update(covariant RenderObjectWidget newWidget) { void update(covariant RenderObjectWidget newWidget) {
super.update(newWidget); super.update(newWidget);
assert(widget == newWidget); assert(widget == newWidget);
assert(() { _debugUpdateRenderObjectOwner(); return true; }); assert(() { _debugUpdateRenderObjectOwner(); return true; }());
widget.updateRenderObject(this, renderObject); widget.updateRenderObject(this, renderObject);
_dirty = false; _dirty = false;
} }
...@@ -4187,7 +4187,7 @@ abstract class RenderObjectElement extends Element { ...@@ -4187,7 +4187,7 @@ abstract class RenderObjectElement extends Element {
assert(() { assert(() {
_renderObject.debugCreator = new _DebugCreator(this); _renderObject.debugCreator = new _DebugCreator(this);
return true; return true;
}); }());
} }
@override @override
......
...@@ -185,7 +185,7 @@ class GestureDetector extends StatelessWidget { ...@@ -185,7 +185,7 @@ class GestureDetector extends StatelessWidget {
} }
} }
return true; return true;
}), }()),
super(key: key); super(key: key);
/// The widget below this widget in the tree. /// The widget below this widget in the tree.
...@@ -524,7 +524,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> { ...@@ -524,7 +524,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> {
); );
} }
return true; return true;
}); }());
_syncAll(gestures); _syncAll(gestures);
if (!widget.excludeFromSemantics) { if (!widget.excludeFromSemantics) {
final RenderSemanticsGestureHandler semanticsGestureHandler = context.findRenderObject(); final RenderSemanticsGestureHandler semanticsGestureHandler = context.findRenderObject();
...@@ -554,7 +554,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> { ...@@ -554,7 +554,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> {
); );
} }
return true; return true;
}); }());
if (!widget.excludeFromSemantics) { if (!widget.excludeFromSemantics) {
final RenderSemanticsGestureHandler semanticsGestureHandler = context.findRenderObject(); final RenderSemanticsGestureHandler semanticsGestureHandler = context.findRenderObject();
semanticsGestureHandler.validActions = actions; semanticsGestureHandler.validActions = actions;
......
...@@ -121,7 +121,7 @@ class Hero extends StatefulWidget { ...@@ -121,7 +121,7 @@ class Hero extends StatefulWidget {
); );
} }
return true; return true;
}); }());
final _HeroState heroState = hero.state; final _HeroState heroState = hero.state;
result[tag] = heroState; result[tag] = heroState;
} }
...@@ -310,7 +310,7 @@ class _HeroFlight { ...@@ -310,7 +310,7 @@ class _HeroFlight {
case _HeroFlightType.push: case _HeroFlightType.push:
return initial.value == 0.0 && initial.status == AnimationStatus.forward; return initial.value == 0.0 && initial.status == AnimationStatus.forward;
} }
}); }());
manifest = initialManifest; manifest = initialManifest;
......
...@@ -173,7 +173,7 @@ class _RenderLayoutBuilder extends RenderBox with RenderObjectWithChildMixin<Ren ...@@ -173,7 +173,7 @@ class _RenderLayoutBuilder extends RenderBox with RenderObjectWithChildMixin<Ren
); );
} }
return true; return true;
}); }());
return true; return true;
} }
......
...@@ -718,7 +718,7 @@ class Navigator extends StatefulWidget { ...@@ -718,7 +718,7 @@ class Navigator extends StatefulWidget {
); );
} }
return true; return true;
}); }());
return navigator; return navigator;
} }
...@@ -779,7 +779,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -779,7 +779,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
), ),
); );
return true; return true;
}); }());
push(_routeNamed(Navigator.defaultRouteName)); push(_routeNamed(Navigator.defaultRouteName));
} else { } else {
for (Route<dynamic> route in plannedInitialRoutes) for (Route<dynamic> route in plannedInitialRoutes)
...@@ -813,7 +813,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -813,7 +813,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
@override @override
void dispose() { void dispose() {
assert(!_debugLocked); assert(!_debugLocked);
assert(() { _debugLocked = true; return true; }); assert(() { _debugLocked = true; return true; }());
for (NavigatorObserver observer in widget.observers) for (NavigatorObserver observer in widget.observers)
observer._navigator = null; observer._navigator = null;
final List<Route<dynamic>> doomed = _poppedRoutes.toList()..addAll(_history); final List<Route<dynamic>> doomed = _poppedRoutes.toList()..addAll(_history);
...@@ -823,7 +823,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -823,7 +823,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
_history.clear(); _history.clear();
focusScopeNode.detach(); focusScopeNode.detach();
super.dispose(); super.dispose();
assert(() { _debugLocked = false; return true; }); assert(() { _debugLocked = false; return true; }());
} }
/// The overlay this navigator uses for its visual presentation. /// The overlay this navigator uses for its visual presentation.
...@@ -859,7 +859,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -859,7 +859,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
); );
} }
return true; return true;
}); }());
route = widget.onUnknownRoute(settings); route = widget.onUnknownRoute(settings);
assert(() { assert(() {
if (route == null) { if (route == null) {
...@@ -872,7 +872,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -872,7 +872,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
); );
} }
return true; return true;
}); }());
} }
return route; return route;
} }
...@@ -908,7 +908,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -908,7 +908,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
/// when the pushed route is popped off the navigator. /// when the pushed route is popped off the navigator.
Future<dynamic> push(Route<dynamic> route) { Future<dynamic> push(Route<dynamic> route) {
assert(!_debugLocked); assert(!_debugLocked);
assert(() { _debugLocked = true; return true; }); assert(() { _debugLocked = true; return true; }());
assert(route != null); assert(route != null);
assert(route._navigator == null); assert(route._navigator == null);
setState(() { setState(() {
...@@ -923,7 +923,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -923,7 +923,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
for (NavigatorObserver observer in widget.observers) for (NavigatorObserver observer in widget.observers)
observer.didPush(route, oldRoute); observer.didPush(route, oldRoute);
}); });
assert(() { _debugLocked = false; return true; }); assert(() { _debugLocked = false; return true; }());
_cancelActivePointers(); _cancelActivePointers();
return route.popped; return route.popped;
} }
...@@ -942,7 +942,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -942,7 +942,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
assert(newRoute != null); assert(newRoute != null);
if (oldRoute == newRoute) if (oldRoute == newRoute)
return; return;
assert(() { _debugLocked = true; return true; }); assert(() { _debugLocked = true; return true; }());
assert(oldRoute._navigator == this); assert(oldRoute._navigator == this);
assert(newRoute._navigator == null); assert(newRoute._navigator == null);
assert(oldRoute.overlayEntries.isNotEmpty); assert(oldRoute.overlayEntries.isNotEmpty);
...@@ -965,7 +965,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -965,7 +965,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
_history[index - 1].didChangeNext(newRoute); _history[index - 1].didChangeNext(newRoute);
oldRoute.dispose(); oldRoute.dispose();
}); });
assert(() { _debugLocked = false; return true; }); assert(() { _debugLocked = false; return true; }());
} }
/// Push the [newRoute] and dispose the old current Route. /// Push the [newRoute] and dispose the old current Route.
...@@ -980,7 +980,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -980,7 +980,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
/// as if the old route had been popped. /// as if the old route had been popped.
Future<dynamic> pushReplacement(Route<dynamic> newRoute, { dynamic result }) { Future<dynamic> pushReplacement(Route<dynamic> newRoute, { dynamic result }) {
assert(!_debugLocked); assert(!_debugLocked);
assert(() { _debugLocked = true; return true; }); assert(() { _debugLocked = true; return true; }());
final Route<dynamic> oldRoute = _history.last; final Route<dynamic> oldRoute = _history.last;
assert(oldRoute != null && oldRoute._navigator == this); assert(oldRoute != null && oldRoute._navigator == this);
assert(oldRoute.overlayEntries.isNotEmpty); assert(oldRoute.overlayEntries.isNotEmpty);
...@@ -1008,7 +1008,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -1008,7 +1008,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
for (NavigatorObserver observer in widget.observers) for (NavigatorObserver observer in widget.observers)
observer.didPush(newRoute, oldRoute); observer.didPush(newRoute, oldRoute);
}); });
assert(() { _debugLocked = false; return true; }); assert(() { _debugLocked = false; return true; }());
_cancelActivePointers(); _cancelActivePointers();
return newRoute.popped; return newRoute.popped;
} }
...@@ -1047,7 +1047,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -1047,7 +1047,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
/// [Route.didChangePrevious]). The navigator observer is not notified. /// [Route.didChangePrevious]). The navigator observer is not notified.
void removeRouteBelow(Route<dynamic> anchorRoute) { void removeRouteBelow(Route<dynamic> anchorRoute) {
assert(!_debugLocked); assert(!_debugLocked);
assert(() { _debugLocked = true; return true; }); assert(() { _debugLocked = true; return true; }());
assert(anchorRoute._navigator == this); assert(anchorRoute._navigator == this);
final int index = _history.indexOf(anchorRoute) - 1; final int index = _history.indexOf(anchorRoute) - 1;
assert(index >= 0); assert(index >= 0);
...@@ -1064,7 +1064,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -1064,7 +1064,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
nextRoute.didChangePrevious(previousRoute); nextRoute.didChangePrevious(previousRoute);
targetRoute.dispose(); targetRoute.dispose();
}); });
assert(() { _debugLocked = false; return true; }); assert(() { _debugLocked = false; return true; }());
} }
/// Push the given route and then remove all the previous routes until the /// Push the given route and then remove all the previous routes until the
...@@ -1080,7 +1080,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -1080,7 +1080,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
/// that always returns false. /// that always returns false.
Future<dynamic> pushAndRemoveUntil(Route<dynamic> newRoute, RoutePredicate predicate) { Future<dynamic> pushAndRemoveUntil(Route<dynamic> newRoute, RoutePredicate predicate) {
assert(!_debugLocked); assert(!_debugLocked);
assert(() { _debugLocked = true; return true; }); assert(() { _debugLocked = true; return true; }());
final List<Route<dynamic>> removedRoutes = <Route<dynamic>>[]; final List<Route<dynamic>> removedRoutes = <Route<dynamic>>[];
while (_history.isNotEmpty && !predicate(_history.last)) { while (_history.isNotEmpty && !predicate(_history.last)) {
final Route<dynamic> removedRoute = _history.removeLast(); final Route<dynamic> removedRoute = _history.removeLast();
...@@ -1107,7 +1107,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -1107,7 +1107,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
for (NavigatorObserver observer in widget.observers) for (NavigatorObserver observer in widget.observers)
observer.didPush(newRoute, oldRoute); observer.didPush(newRoute, oldRoute);
}); });
assert(() { _debugLocked = false; return true; }); assert(() { _debugLocked = false; return true; }());
_cancelActivePointers(); _cancelActivePointers();
return newRoute.popped; return newRoute.popped;
} }
...@@ -1167,11 +1167,11 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -1167,11 +1167,11 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
/// popped. /// popped.
bool pop([dynamic result]) { bool pop([dynamic result]) {
assert(!_debugLocked); assert(!_debugLocked);
assert(() { _debugLocked = true; return true; }); assert(() { _debugLocked = true; return true; }());
final Route<dynamic> route = _history.last; final Route<dynamic> route = _history.last;
assert(route._navigator == this); assert(route._navigator == this);
bool debugPredictedWouldPop; bool debugPredictedWouldPop;
assert(() { debugPredictedWouldPop = !route.willHandlePopInternally; return true; }); assert(() { debugPredictedWouldPop = !route.willHandlePopInternally; return true; }());
if (route.didPop(result ?? route.currentResult)) { if (route.didPop(result ?? route.currentResult)) {
assert(debugPredictedWouldPop); assert(debugPredictedWouldPop);
if (_history.length > 1) { if (_history.length > 1) {
...@@ -1190,13 +1190,13 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -1190,13 +1190,13 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
observer.didPop(route, _history.last); observer.didPop(route, _history.last);
}); });
} else { } else {
assert(() { _debugLocked = false; return true; }); assert(() { _debugLocked = false; return true; }());
return false; return false;
} }
} else { } else {
assert(!debugPredictedWouldPop); assert(!debugPredictedWouldPop);
} }
assert(() { _debugLocked = false; return true; }); assert(() { _debugLocked = false; return true; }());
_cancelActivePointers(); _cancelActivePointers();
return true; return true;
} }
...@@ -1213,7 +1213,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -1213,7 +1213,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
void removeRoute(Route<dynamic> route) { void removeRoute(Route<dynamic> route) {
assert(route != null); assert(route != null);
assert(!_debugLocked); assert(!_debugLocked);
assert(() { _debugLocked = true; return true; }); assert(() { _debugLocked = true; return true; }());
assert(route._navigator == this); assert(route._navigator == this);
final int index = _history.indexOf(route); final int index = _history.indexOf(route);
assert(index != -1); assert(index != -1);
...@@ -1227,7 +1227,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -1227,7 +1227,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
observer.didRemove(route, previousRoute); observer.didRemove(route, previousRoute);
route.dispose(); route.dispose();
}); });
assert(() { _debugLocked = false; return true; }); assert(() { _debugLocked = false; return true; }());
_cancelActivePointers(); _cancelActivePointers();
} }
......
...@@ -251,7 +251,7 @@ class Overlay extends StatefulWidget { ...@@ -251,7 +251,7 @@ class Overlay extends StatefulWidget {
); );
} }
return true; return true;
}); }());
return result; return result;
} }
...@@ -331,7 +331,7 @@ class OverlayState extends State<Overlay> with TickerProviderStateMixin { ...@@ -331,7 +331,7 @@ class OverlayState extends State<Overlay> with TickerProviderStateMixin {
break; break;
} }
return true; return true;
}); }());
return result; return result;
} }
......
...@@ -369,7 +369,7 @@ class ClampingScrollPhysics extends ScrollPhysics { ...@@ -369,7 +369,7 @@ class ClampingScrollPhysics extends ScrollPhysics {
); );
} }
return true; return true;
}); }());
if (value < position.pixels && position.pixels <= position.minScrollExtent) // underscroll if (value < position.pixels && position.pixels <= position.minScrollExtent) // underscroll
return value - position.pixels; return value - position.pixels;
if (position.maxScrollExtent <= position.pixels && position.pixels < value) // overscroll if (position.maxScrollExtent <= position.pixels && position.pixels < value) // overscroll
......
...@@ -209,7 +209,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { ...@@ -209,7 +209,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics {
); );
} }
return true; return true;
}); }());
final double oldPixels = _pixels; final double oldPixels = _pixels;
_pixels = newPixels - overscroll; _pixels = newPixels - overscroll;
if (_pixels != oldPixels) { if (_pixels != oldPixels) {
...@@ -351,7 +351,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { ...@@ -351,7 +351,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics {
); );
} }
return true; return true;
}); }());
return result; return result;
} }
......
...@@ -842,7 +842,7 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render ...@@ -842,7 +842,7 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render
final SliverMultiBoxAdaptorParentData childParentData = child.parentData; final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
assert(slot == childParentData.index); assert(slot == childParentData.index);
return true; return true;
}); }());
} }
@override @override
......
...@@ -111,7 +111,7 @@ class Table extends RenderObjectWidget { ...@@ -111,7 +111,7 @@ class Table extends RenderObjectWidget {
); );
} }
return true; return true;
}), }()),
assert(() { assert(() {
if (children.any((TableRow row1) => row1.key != null && children.any((TableRow row2) => row1 != row2 && row1.key == row2.key))) { if (children.any((TableRow row1) => row1.key != null && children.any((TableRow row2) => row1 != row2 && row1.key == row2.key))) {
throw new FlutterError( throw new FlutterError(
...@@ -120,7 +120,7 @@ class Table extends RenderObjectWidget { ...@@ -120,7 +120,7 @@ class Table extends RenderObjectWidget {
); );
} }
return true; return true;
}), }()),
assert(() { assert(() {
if (children.isNotEmpty) { if (children.isNotEmpty) {
final int cellCount = children.first.children.length; final int cellCount = children.first.children.length;
...@@ -133,7 +133,7 @@ class Table extends RenderObjectWidget { ...@@ -133,7 +133,7 @@ class Table extends RenderObjectWidget {
} }
} }
return true; return true;
}), }()),
_rowDecorations = children.any((TableRow row) => row.decoration != null) _rowDecorations = children.any((TableRow row) => row.decoration != null)
? children.map<Decoration>((TableRow row) => row.decoration).toList(growable: false) ? children.map<Decoration>((TableRow row) => row.decoration).toList(growable: false)
: null, : null,
...@@ -149,7 +149,7 @@ class Table extends RenderObjectWidget { ...@@ -149,7 +149,7 @@ class Table extends RenderObjectWidget {
); );
} }
return true; return true;
}); }());
} }
/// The rows of the table. /// The rows of the table.
...@@ -243,7 +243,7 @@ class _TableElement extends RenderObjectElement { ...@@ -243,7 +243,7 @@ class _TableElement extends RenderObjectElement {
void mount(Element parent, dynamic newSlot) { void mount(Element parent, dynamic newSlot) {
super.mount(parent, newSlot); super.mount(parent, newSlot);
assert(!_debugWillReattachChildren); assert(!_debugWillReattachChildren);
assert(() { _debugWillReattachChildren = true; return true; }); assert(() { _debugWillReattachChildren = true; return true; }());
_children = widget.children.map((TableRow row) { _children = widget.children.map((TableRow row) {
return new _TableElementRow( return new _TableElementRow(
key: row.key, key: row.key,
...@@ -253,7 +253,7 @@ class _TableElement extends RenderObjectElement { ...@@ -253,7 +253,7 @@ class _TableElement extends RenderObjectElement {
}).toList(growable: false) }).toList(growable: false)
); );
}).toList(growable: false); }).toList(growable: false);
assert(() { _debugWillReattachChildren = false; return true; }); assert(() { _debugWillReattachChildren = false; return true; }());
_updateRenderObjectChildren(); _updateRenderObjectChildren();
} }
...@@ -278,7 +278,7 @@ class _TableElement extends RenderObjectElement { ...@@ -278,7 +278,7 @@ class _TableElement extends RenderObjectElement {
return true; return true;
} }
return false; return false;
}); }());
final TableCellParentData childParentData = child.parentData; final TableCellParentData childParentData = child.parentData;
renderObject.setChild(childParentData.x, childParentData.y, null); renderObject.setChild(childParentData.x, childParentData.y, null);
} }
...@@ -288,7 +288,7 @@ class _TableElement extends RenderObjectElement { ...@@ -288,7 +288,7 @@ class _TableElement extends RenderObjectElement {
@override @override
void update(Table newWidget) { void update(Table newWidget) {
assert(!_debugWillReattachChildren); assert(!_debugWillReattachChildren);
assert(() { _debugWillReattachChildren = true; return true; }); assert(() { _debugWillReattachChildren = true; return true; }());
final Map<LocalKey, List<Element>> oldKeyedRows = new Map<LocalKey, List<Element>>.fromIterable( final Map<LocalKey, List<Element>> oldKeyedRows = new Map<LocalKey, List<Element>>.fromIterable(
_children.where((_TableElementRow row) => row.key != null), _children.where((_TableElementRow row) => row.key != null),
key: (_TableElementRow row) => row.key, key: (_TableElementRow row) => row.key,
...@@ -316,7 +316,7 @@ class _TableElement extends RenderObjectElement { ...@@ -316,7 +316,7 @@ class _TableElement extends RenderObjectElement {
updateChildren(oldUnkeyedRows.current.children, const <Widget>[], forgottenChildren: _forgottenChildren); updateChildren(oldUnkeyedRows.current.children, const <Widget>[], forgottenChildren: _forgottenChildren);
for (List<Element> oldChildren in oldKeyedRows.values.where((List<Element> list) => !taken.contains(list))) for (List<Element> oldChildren in oldKeyedRows.values.where((List<Element> list) => !taken.contains(list)))
updateChildren(oldChildren, const <Widget>[], forgottenChildren: _forgottenChildren); updateChildren(oldChildren, const <Widget>[], forgottenChildren: _forgottenChildren);
assert(() { _debugWillReattachChildren = false; return true; }); assert(() { _debugWillReattachChildren = false; return true; }());
_children = newChildren; _children = newChildren;
_updateRenderObjectChildren(); _updateRenderObjectChildren();
_forgottenChildren.clear(); _forgottenChildren.clear();
......
...@@ -92,7 +92,7 @@ abstract class SingleTickerProviderStateMixin extends State<dynamic> implements ...@@ -92,7 +92,7 @@ abstract class SingleTickerProviderStateMixin extends State<dynamic> implements
'objects and those objects might use it more than one time in total, then instead of ' 'objects and those objects might use it more than one time in total, then instead of '
'mixing in a SingleTickerProviderStateMixin, use a regular TickerProviderStateMixin.' 'mixing in a SingleTickerProviderStateMixin, use a regular TickerProviderStateMixin.'
); );
}); }());
_ticker = new Ticker(onTick, debugLabel: 'created by $this'); _ticker = new Ticker(onTick, debugLabel: 'created by $this');
// We assume that this is called from initState, build, or some sort of // We assume that this is called from initState, build, or some sort of
// event handler, and that thus TickerMode.of(context) would return true. We // event handler, and that thus TickerMode.of(context) would return true. We
...@@ -115,7 +115,7 @@ abstract class SingleTickerProviderStateMixin extends State<dynamic> implements ...@@ -115,7 +115,7 @@ abstract class SingleTickerProviderStateMixin extends State<dynamic> implements
'Otherwise, the ticker will leak.\n' 'Otherwise, the ticker will leak.\n'
'The offending ticker was: ${_ticker.toString(debugIncludeStack: true)}' 'The offending ticker was: ${_ticker.toString(debugIncludeStack: true)}'
); );
}); }());
super.dispose(); super.dispose();
} }
...@@ -195,7 +195,7 @@ abstract class TickerProviderStateMixin extends State<dynamic> implements Ticker ...@@ -195,7 +195,7 @@ abstract class TickerProviderStateMixin extends State<dynamic> implements Ticker
} }
} }
return true; return true;
}); }());
super.dispose(); super.dispose();
} }
......
...@@ -406,7 +406,7 @@ class _InspectorOverlayLayer extends Layer { ...@@ -406,7 +406,7 @@ class _InspectorOverlayLayer extends Layer {
assert(() { assert(() {
inDebugMode = true; inDebugMode = true;
return true; return true;
}); }());
if (inDebugMode == false) { if (inDebugMode == false) {
throw new FlutterError( throw new FlutterError(
'The inspector should never be used in production mode due to the ' 'The inspector should never be used in production mode due to the '
......
...@@ -115,7 +115,7 @@ Future<Null> benchmarkWidgets(WidgetTesterCallback callback) { ...@@ -115,7 +115,7 @@ Future<Null> benchmarkWidgets(WidgetTesterCallback callback) {
print('│ '); print('│ ');
print('└─────────────────────────────────────────────────╌┄┈ 🐢'); print('└─────────────────────────────────────────────────╌┄┈ 🐢');
return true; return true;
}); }());
final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized(); final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
assert(binding is! AutomatedTestWidgetsFlutterBinding); assert(binding is! AutomatedTestWidgetsFlutterBinding);
final WidgetTester tester = new WidgetTester._(binding); final WidgetTester tester = new WidgetTester._(binding);
......
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