Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The image not fill all toggle space #51

Open
caokietbk opened this issue May 17, 2022 · 0 comments · May be fixed by #52
Open

The image not fill all toggle space #51

caokietbk opened this issue May 17, 2022 · 0 comments · May be fixed by #52

Comments

@caokietbk
Copy link

caokietbk commented May 17, 2022

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

@LeGoffMael LeGoffMael linked a pull request May 17, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant