【问题标题】:how to make a column inside a stack scrollable?如何使堆栈内的列可滚动?
【发布时间】:2021-03-10 16:04:41
【问题描述】:
Scaffold(
      resizeToAvoidBottomInset: true,
      backgroundColor: Color(0xff1D1B20),
      body: SafeArea(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            Image.asset(
              "assets/sign_car.png",
              height: MediaQuery.of(context).size.height * 0.88,
            ),
            Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Spacer(),
                SizedBox(
                  height: 40.0,
                ),
                Text("Welcome",
                    style: TextStyle(color: Color(0xffD8D8D8), fontSize: 25.0)),
                SizedBox(
                  height: 10.0,
                ),
                Text("Sign In",
                    style: TextStyle(
                      fontSize: 15.0,
                      color: Color(0xffD8D8D8),
                    )),
                SizedBox(
                  height: 10.0,
                ),
                ConstrainedBox(
                  constraints: BoxConstraints(
                      maxWidth: MediaQuery.of(context).size.width * 0.56),
                  child: Input(
                    text: "Name",
                    height: 45.0,
                    fonttext: 14.0,
                  ),
                ),
                ConstrainedBox(
                  constraints: BoxConstraints(
                      maxWidth: MediaQuery.of(context).size.width * 0.56),
                  child: Input(
                    text: "Email",
                    height: 45.0,
                    fonttext: 14.0,
                  ),
                ),
                ConstrainedBox(
                  constraints: BoxConstraints(
                      maxWidth: MediaQuery.of(context).size.width * 0.56),
                  child: Input(
                    text: "Password",
                    height: 45.0,
                    fonttext: 14.0,
                    toppadding: 10.0,
                    suffixIcon: Icon(
                      Icons.panorama_fish_eye_sharp,
                      color: Colors.white,
                      size: 10.0,
                    ),
                  ),
                ),
                SizedBox(
                  height: 10.0,
                ),
                Container(
                  width: MediaQuery.of(context).size.width * 0.56,
                  child: Text("Forget Password ?",
                      textAlign: TextAlign.left,
                      style: TextStyle(
                        fontSize: 13.0,
                        color: Color(0xffFFD700),
                      )),
                ),
                SizedBox(
                  height: 30.0,
                ),
                InkWell(
                  onTap: () {},
                  child: Container(
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(10),
                        color: Color(0xffFFD700),
                      ),
                      width: MediaQuery.of(context).size.width * 0.56,
                      height: 45,
                      child: Center(
                        child: Text(
                          "Create Account",
                          style: TextStyle(
                            color: Colors.black,
                            fontSize: 18,
                          ),
                          textAlign: TextAlign.center,
                        ),
                      )),
                ),
                SizedBox(
                  height: 60.0,
                ),
                Container(
                  child: Text("If already have an account",
                      style: TextStyle(
                        fontSize: 14.0,
                        color: Colors.white,
                      )),
                ),
                SizedBox(
                  height: 10.0,
                ),
                InkWell(
                  onTap: () {},
                  child: Container(
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(10),
                        border:
                            Border.all(width: 1.0, color: Color(0xffFFD700)),
                        color: Colors.transparent,
                      ),
                      width: MediaQuery.of(context).size.width * 0.56,
                      height: 45,
                      child: Center(
                        child: Text(
                          "Login",
                          style: TextStyle(
                            color: Color(0xffFFD700),
                            fontSize: 18,
                          ),
                          textAlign: TextAlign.center,
                        ),
                      )),
                ),
                SizedBox(
                  height: 30.0,
                ),
              ],
            ),
          ],
        ),
      ),
    );

【问题讨论】:

    标签: flutter


    【解决方案1】:

    您必须阅读有关SingleChildScrollView 的信息。 在这里您可以找到所有需要的示例。

    【讨论】:

      猜你喜欢
      • 2011-03-10
      • 2020-01-04
      • 2014-12-10
      • 1970-01-01
      • 1970-01-01
      • 2021-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多