How to prevent flutter text field text from disappearing when the input text width exceeds the the width of the text field?

Viewed 563

I have a text field that I use to collect user input but when the width of the string exceeds the bounds of the text field the text disappears. How do I get the text to overflow by continously offsetting the text to the left as the length of the text increases?

Here is a demonstration of the undesired action, notice the text disappears after the 9th key is entered.

enter image description here

Here is my code snippet:

  Text.rich(
              TextSpan(
                  text: '',
                  children: <InlineSpan>[
                    WidgetSpan(
                        alignment: PlaceholderAlignment.baseline,
                        baseline: TextBaseline.alphabetic,
                        child: Container(
                          width: 130,
                          height: 30,
                          child: TextField(
                            controller: textFieldControllerList[i],
                            keyboardType: TextInputType.number,
                            style: TextStyle(
                                fontSize: 25.0,
                                color: textFieldColors[i],
                                decorationColor: textFieldColors[i]
                            ),
                            decoration: InputDecoration(
                                enabledBorder: OutlineInputBorder(
                                  borderSide: BorderSide(color: textFieldColors[i], width: 1.0),
                                ),
                                focusedBorder: OutlineInputBorder(
                                  borderSide: BorderSide(color: textFieldColors[i], width: 2.0),
                                ),
                                border: OutlineInputBorder(),
                                labelText: answer.label,
                              labelStyle: TextStyle(color: textFieldColors[i])
                            ),
                          ),
                        )
                    ),
                    TextSpan(text: answer.unitSymbol,style: TextStyle(fontSize: 25))
                  ])
          )
0 Answers
Related