public override void applyPaintTransform(RenderObject child, Matrix4 transform)
        {
            _ToolbarParentData childParentData = child.parentData as _ToolbarParentData;

            transform.translate(childParentData.offset.dx, childParentData.offset.dy);
            base.applyPaintTransform(child, transform);
        }
        protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null)
        {
            _ToolbarParentData childParentData = child.parentData as _ToolbarParentData;

            return(result.addWithPaintOffset(
                       offset: childParentData.offset,
                       position: position,
                       hitTest: (BoxHitTestResult boxResult, Offset boxTransformed) => {
                D.assert(boxTransformed == position - childParentData.offset);
                return child.hitTest(boxResult, position: boxTransformed);
            }
                       ));
        }
        protected override void performLayout()
        {
            child.layout(constraints.loosen(), parentUsesSize: true);

            if (!overflowOpen && _closedWidth == null)
            {
                _closedWidth = child.size.width;
            }

            size = constraints.constrain(new Size(
                                             (_closedWidth == null || child.size.width > _closedWidth) ? child.size.width : _closedWidth.Value,
                                             child.size.height
                                             ));

            _ToolbarParentData childParentData = child.parentData as _ToolbarParentData;

            childParentData.offset = new Offset(
                size.width - child.size.width,
                0.0f
                );
        }
        public override void paint(PaintingContext context, Offset offset)
        {
            _ToolbarParentData childParentData = child.parentData as _ToolbarParentData;

            context.paintChild(child, childParentData.offset + offset);
        }