Abhilash-Chandran / number_inc_dec

A flutter widget to accept numeric inputs with button to increment and decrement.

Home Page:https://pub.dev/packages/number_inc_dec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shows a separator even when separated Icons are left to true. [bug]

opened this issue · comments

image
image

 NumberInputWithIncrementDecrement(
      controller: TextEditingController(),
      min: 1,
      enabled: true,
      decIcon: Icons.remove,
      incIcon: Icons.add,
      separateIcons: true,
      // decIconDecoration: BoxDecoration(
      //     border: Border.all(
      //         color: Colors.transparent,
      //         style: BorderStyle.none)),
      decIconColor: Colors.red[400],
      incIconColor: greenHeading,
      widgetContainerDecoration:
          BoxDecoration(
              border: Border.all(
                  color: Colors
                      .transparent)),
      numberFieldDecoration:
          InputDecoration(
        enabledBorder:
            UnderlineInputBorder(
          borderSide: BorderSide(
              color: headingtextColor),
        ),
        focusedBorder:
            UnderlineInputBorder(
          borderSide: BorderSide(
              color: headingtextColor),
        ),
        fillColor: Colors.transparent,
      ),
      scaleHeight: 0.8,
      scaleWidth: 0.8,
      max: 50,
    ),

Turns out you have to explicitly override incIconDecoration to get rid of the separator.

incIconDecoration: BoxDecoration(), \\or any other decoration you like.

Thanks for reporting @RazaShabbir-vrc. I verified the code and I am adding a black border to the bottom in the incIconDecoration. This is to ensure the buttons are visibly separate. If you don't want to see any border, yes you will have to completely override the decoration. So I think your approach is correct. Feel free to reopen the issue if you want to discuss further any alternatives that you would expect.