I would like my text background in Textfield looks like this :
But with this code :
style: TextStyle(
background: Paint()..color = Colors.blue
..style = PaintingStyle.fill,
color: Colors.white,
),
I have this result :
There is no padding, no rounded corners and a transparent line between both...
How can I do this ?
EDIT :
Another way with TextStyle was provided by @Csaba Mihaly but this is a workaround I want to avoid. I'm looking for a custom paint solution
EDIT :
According answers provided PaintStyle.stroke can be used but it's not 100% matching the expected result (first screen) :
No matter the text size is, in order to fill the empty space the stroke width must be bigger as I can see. It will render a large padding and corner radius. In my case :







