I am currently trying to implement a TextField that should change the background Color-based on the state of the Text Field (unfocused, focused, error).
I have tried to implement this by using a List that manages only whether the TextField is selected or not. I use a GestureDetector to set that value. But this seems way too hacky to be a good solution, especially because tapping on the TextField isn't the only way to focus it.
At this point, I was hoping that there is a way to get the same information the TextField Widget uses to display the appropriate border style. But I am not sure if it is possible to access this information. A tip on how to do so would be highly appreciated.
I was also thinking that I could use the FocusScope for this, but I could not find a way to call .hasFocus on a single TextFormField, because it only shows me whether one TextFormField in the whole Form is selected and not which one.
Thank you!