본문 바로가기
Computer Engineering/안드로이드 Flutter

[Flutter] Body에서 수직(Column)으로 배열 되는 경우에 정렬방법

by UC우공 2019. 11. 10.

 

바디에서 수직(Column)으로 배열 되는 경우에 정렬방법

crossAxisAlignment: CrossAxisAlignment.start,

crossAxisAlignment: CrossAxisAlignment.center,

    return Scaffold(
      body: Stack(
        alignment: Alignment.center,
        children: <Widget>[
          Container(
            color: Colors.white,
          ),
          Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.end,
              children: <Widget>[
                Container(
                  width: 200,
                  height: 200,
                  color: Colors.blue,
                ),
                Stack(
                  children: <Widget>[
                    Form(
                        key: _formKey,
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: <Widget>[
                            TextFormField(
                              controller: _emailController,
                              decoration: InputDecoration(
                                  icon: Icon(Icons.account_circle),
                                  labelText: "Email"),
                                  validator: (String value){
                                    if (value.isEmpty)
                                      return "Please, input the valid email account.";
                                    else
                                      return null;
                                  },
                            ), //유저들이 입력하는 란
                            TextFormField(
                              controller: _passwordController,
                              decoration: InputDecoration(
                                  icon: Icon(Icons.vpn_key),
                                  labelText: "Password"),
                              validator: (String value){
                                if (value.isEmpty)
                                  return "Please, input the valid password.";
                                else
                                  return null;
                              },
                            ),
                            Text("Forgot Password?"),
                          ],
                        )),
//                  Container(width: 100, height: 50, color: Colors.black,),
                  ],
                ),
                Container(
                  height: size.height * 0.10,
                ),
                Text("Don't Have an Account? Creat One"),
                Container(
                  height: size.height * 0.05,
                ),
              ])
        ],
      ),
    );
  }
}

 

댓글