build method

  1. @override
Widget build(
  1. BuildContext context
)
override

页面结构:左侧的透明黑 + 右侧宽为300的内容区域

Implementation

@override
Widget build(BuildContext context) {
  return Scaffold(
    backgroundColor: const Color(0x660c0c0c),
    body: Row(
      children: <Widget>[
        _buildLeftSlide(context),
        AnimatedBuilder(
          animation: _controller,
          builder: (context, child) {
            return SlideTransition(
              position: _animation,
              child: child,
            );
          },
          child: _buildRightSlide(context),
        )
      ],
    ),
    //为了解决 键盘抬起按钮的问题 将按钮移动到 此区域
    bottomNavigationBar: SizedBox(
      height: 80 + _getBottomAreaHeight(),
      child: Row(
        children: <Widget>[
          _buildLeftSlide(context),
          AnimatedBuilder(
            animation: _controller,
            builder: (context, child) {
              return SlideTransition(
                position: _animation,
                child: child,
              );
            },
            child: Container(
              width: 300,
              color: Colors.white,
              child: Column(
                children: <Widget>[
                  const TLine(),
                  Padding(
                    padding: const EdgeInsets.only(top: 14),
                    child: _buildBottomButtons(),
                  ),
                ],
              ),
            ),
          )
        ],
      ),
    ),
  );
}