Avoid 'as' keyword
It has performance implications in release mode. We'll enable the lint once https://github.com/dart-lang/linter/issues/195 is fixed.
This commit is contained in:
@@ -138,14 +138,14 @@ class Instrumentation {
|
||||
/// the element's render object has been laid out at least once.
|
||||
Size getSize(Element element) {
|
||||
assert(element != null);
|
||||
RenderBox box = element.renderObject as RenderBox;
|
||||
RenderBox box = element.renderObject;
|
||||
assert(box != null);
|
||||
return box.size;
|
||||
}
|
||||
|
||||
Point _getElementPoint(Element element, SizeToPointFunction sizeToPoint) {
|
||||
assert(element != null);
|
||||
RenderBox box = element.renderObject as RenderBox;
|
||||
RenderBox box = element.renderObject;
|
||||
assert(box != null);
|
||||
return box.localToGlobal(sizeToPoint(box.size));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user