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

Q: How to hide color preview, Make slider container's height adjustable #95

Open
3g015st opened this issue Jan 8, 2023 · 1 comment

Comments

@3g015st
Copy link

3g015st commented Jan 8, 2023

tnongers

The title and photo speak for themselves. Thanks to whoever answers this 😄

@xarDeves
Copy link

xarDeves commented Aug 14, 2024

The actual class is in palette.dart named ColorIndicator.
There is also a flag in colorpicker.dart named this.showIndicator and it is set to true.

Setting the above flag to false however does not do anything.
Commenting out the whole GestureDetector block from the picker "version" you are currently using does the trick however...
for example, the comented lines should be (located in colorpicker.dart):

GestureDetector(
  onTap: () => setState(() {
    if (widget.onHistoryChanged != null && !colorHistory.contains(currentHsvColor.toColor())) {
      colorHistory.add(currentHsvColor.toColor());
      widget.onHistoryChanged!(colorHistory);
    }
  }),
  child: ColorIndicator(currentHsvColor),
),

This is quite annoying, if the flag could be fixed to do what it is supposed to it would be much appreciated.

PS. if you are to fiddle with the code, make sure to copy the files that flutter downloaded to your source directory and import these to use in your code instead...

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

No branches or pull requests

2 participants