Skip to content

The image not fill all toggle space #51

@caokietbk

Description

@caokietbk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions