4
votes

I have this basic textfield:

          new TextField(
            style: new TextStyle(fontSize: 20.0, color: Colors.blue),
            onChanged: (InputValue newInputValue) {
              setState(() {
                inputValue = newInputValue;
            });
          }),

I now want to make the text float to the center when the user types something in. So I went to the docs and it told me to use the textAlign property.

              new TextField(
                textAlign: TextAlign.center;
                style: new TextStyle(fontSize: 20.0, color: Colors.blue),
                onChanged: (InputValue newInputValue) {
                  setState(() {
                    inputValue = newInputValue;
                });
              }),

But for some reason, Flutter tells me that the property TextAlign does not exist.

1
What commit are you on? It seems textAlign was only added a month ago: github.com/flutter/flutter/commit/… - david.mihola
Yep, upgrading solved the issue.. could have thought about that, thanks - OhMad

1 Answers

4
votes

I just had to upgrade flutter and it worked. TextAlign has been added very recently...