Remove last old-style asserts-with-string (#3923)

Use the FlutterError hotness instead.

Fixes #1290
This commit is contained in:
Adam Barth 2016-05-16 10:37:58 -07:00
parent 55f9145ef4
commit a078994ac9

View File

@ -507,7 +507,11 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
crossSize = math.max(crossSize, _getCrossSize(child));
}
if (crossAxisAlignment == CrossAxisAlignment.baseline) {
assert(textBaseline != null && 'To use FlexAlignItems.baseline, you must also specify which baseline to use using the "baseline" argument.' is String);
assert(() {
if (textBaseline == null)
throw new FlutterError('To use FlexAlignItems.baseline, you must also specify which baseline to use using the "baseline" argument.');
return true;
});
double distance = child.getDistanceToBaseline(textBaseline, onlyReal: true);
if (distance != null)
maxBaselineDistance = math.max(maxBaselineDistance, distance);