I wanted to make a simple calculator using Flutter so in the TextField, I have set the TextDirection as Right to Left.
child: TextField(
textDirection: TextDirection.rtl,
style: Theme.of(context).textTheme.title,
showCursor: true,
readOnly: true,
controller: displayController,
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
)
),
),
When I pressed a Raised Button the onPressed method works as this,
void digitHandler(String char)
{
displayController.text=displayController.text+char;
}
This String char parameter changes according to the button.
But when I press the '.' symbol the cursor moves into the beginning of that line.
In here I have pressed 5,6 and then dot(.) accordingly. But it displays ".56":

Nothing wrong with the Button onPressed Method and nothing wrong with the TextField Widget.