Closed Siwen closed 3 years ago
I have Fixed It !!!! :>
// --->
// 以下工作,只为保证LeftChild保持状态存活
// 导致原因是:Stack在显示RightChild时,LeftChild从Stack的childs中移除导致
// 也就是说 Stack 只保存当前显示内容和上一个页面
Widget leftChildKeepAlive = Container();
if( _position != InnerDrawerDirection.start) {
leftChildKeepAlive = Offstage(
offstage: true,
child: widget.leftChild,
);
}
// <----
return Container(
decoration: widget.backgroundDecoration ??
BoxDecoration(
color: Theme.of(context).backgroundColor,
),
child: Stack(
alignment: _drawerInnerAlignment,
children: <Widget>[
// --- >
leftChildKeepAlive,
// < ----
FocusScope(node: _focusScopeNode, child: _animatedChild()),
I use both LeftSide and RightSide, but I show Right, then Left will be unmount! who to hold leftside?