measure method
Returns a dimension client rectangle for element
.
If offset
is true, returns the offset positions from the parent instead
of absolute.
Throws StateError if element
is not within the live DOM.
Implementation
@override
Future<Rectangle> measure(Element element, {bool offset = false}) {
if (canSyncWrite(element)) {
// It is not possible to measure something not in the live DOM.
// throw new StateError('Element is not in the live DOM document.');
return Future<Rectangle>.value(const Rectangle(0, 0, 0, 0));
}
return super.measure(element, offset: offset);
}