Search code examples
flutterdartflutter-layoutflutter-dependencies

numberpicker decoration is over the number


I'm using the pub numberpicker and there is a parameter called decoration that I think is to do what i need, but the decoration (from a suposed container) is appearing over the number instead of below.

The code:

 NumberPicker(
                    decoration: BoxDecoration(
                      color: AppColors.morat,
                      borderRadius: BorderRadius.circular(30),
                    ),
                    textStyle: AppTextStyle.lightXS.copyWith(color: Colors.white),
                    selectedTextStyle: AppTextStyle.boldLarge.copyWith(color: Colors.white),
                    itemWidth: 50,
                    itemHeight: 30,
                    zeroPad: true,
                    value: 12,
                    minValue: 0,
                    maxValue: 23,
                    step: 1,
                    onChanged: (value) {},
                  ),

The result: enter image description here the desired result (w/ photoshop): enter image description here


Solution

  • Would you like to try the stack widget? Try placing the boxdecoration at the bottom of the stack and placing the numberpicker above it.