Home > Net >  How to remove the space between SpinBox content and underline?
How to remove the space between SpinBox content and underline?

Time:01-17

My question is essentially the same as isDense: true

Meanwhile, wrapping in a SizedBox and setting height is some improvement, but I am not able to shrink height as much as I would like, or increment/decrement go below the line. This is with a height of 25:

Height 25

Having a height of 45 looks visually fine but it takes up too much space for my needs.

Current code which produces the layout below:

SizedBox(
  width: 120,
  height: 45,
  child: SpinBox(
    value: 0,
    onChanged: (value) {}
  ),
)

enter image description here

CodePudding user response:

Looking at the source code of the SpinBox you can see that you have the inputDecoration of the TextField exposed, and you can try removing the contentPadding of it and see if it fixes your issue :

SpinBox(
  decoration: InputDecoration(
    contentPadding: EdgeInsets.zero,
  ),
);
  •  Tags:  
  • Related