1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'box.dart';
import 'object.dart';
/// Lays the child out as if it was in the tree, but without painting anything,
/// without making the child available for hit testing, and without taking any
/// room in the parent.
class RenderOffStage extends RenderBox with RenderObjectWithChildMixin<RenderBox> {
/// Creates an off-stage render object.
RenderOffStage({ RenderBox child }) {
this.child = child;
}
@override
bool get sizedByParent => true;
@override
void performResize() {
size = constraints.smallest;
}
@override
void performLayout() {
if (child != null)
child.layout(constraints);
}
@override
bool hitTest(HitTestResult result, { Point position }) => false;
@override
void paint(PaintingContext context, Offset offset) { }
@override
void visitChildrenForSemantics(RenderObjectVisitor visitor) { }
}