FlutterSwitch icon indicating copy to clipboard operation
FlutterSwitch copied to clipboard

The image not fill all toggle space

Open caokietbk opened this issue 3 years ago • 0 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. create the switch with active icon = Image.asset.
  2. change toggleColor: Colors.red (to make it more visible)
  3. See error

Expected behavior The image should be filled and have a fixed height and width (no red color).

Screenshots image

Smartphone (please complete the following information):

  • Device: iPhone Xr
  • OS: iOS15

Additional context Source code:

return FlutterSwitch(
      value: _currentValue,
      onToggle: (newValue) {
        setState(() {
          _currentValue = newValue;
        });
      },
      height: 30,
      activeIcon: Image.asset(
        'slider-thumb'.pngAssetsPath,
        height: 30,
      ),
      inactiveIcon: Image.asset(
        'slider-thumb'.pngAssetsPath,
        height: 30,
      ),
      toggleColor: Colors.red,
      activeColor: CustomColors.greenIndicator,
      inactiveColor: CustomColors.pinkIndicator,
);

Thanks

caokietbk avatar May 17 '22 04:05 caokietbk