samedi 13 juillet 2019

Flutter for web, can't type into a TextField

So I'm creating a flutter for web application. A little risky but I really just want an initial prototype, and hopefully by the time I need something production ready it's in at least beta.

Anyways, I'm trying to create a login page, and I can't actually enter anything into the TextFiled.

I've tried adding/removing the TextEdditingController and the input decoration. I've tried a TextField and a TextFormField as well

Widget loginWidget() {
    return Container(
      width: 650,
      child: Card(
        margin: EdgeInsets.all(5.0),
        color: UiColors.CardBlue,
        child: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Row(
              mainAxisSize: MainAxisSize.min,
              children: <Widget>[
                MaterialButton(
                  minWidth: 300,
                  color: UiColors.CardBlue,
                  child: Text("Login", style: TextStyle(color: Colors.white),),
                  onPressed: (){}, // do nothing, this is already the login
                ),
                MaterialButton(
                  minWidth: 300,
                  elevation: 10,
                  color: UiColors.ButtonBlue,
                  child: Text("Register", style: TextStyle(color: Colors.white),),
                  onPressed: toggleLogin,
                )
              ],
            ),
            TextField(
              controller: usernameController,
              decoration: InputDecoration(
                border: InputBorder.none,
                labelText: "Email Address",
                hintText: "user@email.com"
              ),
            )
          ],
        ),
      ),
    );
  } 




Aucun commentaire:

Enregistrer un commentaire