Clarify Offstage docs (#18089)

This commit is contained in:
Michael Goderbauer 2018-06-01 15:22:33 -07:00 committed by GitHub
parent 529d250453
commit 026c89835f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2203,9 +2203,18 @@ class SizedOverflowBox extends SingleChildRenderObjectWidget {
/// without making the child available for hit testing, and without taking any
/// room in the parent.
///
/// Animations continue to run in offstage children, and therefore use battery
/// and CPU time, regardless of whether the animations end up being visible.
///
/// [Offstage] can be used to measure the dimensions of a widget without
/// bringing it on screen (yet). To hide a widget from view while it is not
/// needed, prefer removing the widget from the tree entirely rather than
/// keeping it alive in an [Offstage] subtree.
///
/// See also:
///
/// * The [catalog of layout widgets](https://flutter.io/widgets/layout/).
/// * [TickerMode], which can be used to disable animations in a subtree.
class Offstage extends SingleChildRenderObjectWidget {
/// Creates a widget that visually hides its child.
const Offstage({ Key key, this.offstage: true, Widget child })