Josip Domazet
Josip Domazet

Reputation: 2890

Flutter: Remove brightness bar from flutter_colorpicker

I used the flutter_colorpicker package to implement a color picker in my app. My widget looks something like this:

ColorPicker(
  pickerColor: ...,
  paletteType: PaletteType.hueWheel,
  onColorChanged: (color) {
    ...
  },
  enableAlpha: false,
  labelTypes: const [],
)

In the UI it looks like this:

enter image description here

Now I want to remove the brightness bar on the bottom. I know that the color picker is not complete without that brighness bar but I will handle the brightness a different way. I have found no official documentation on how to achieve this.

How do I remove that bar? Hacks are also welcome or somehow extending the package with inheritance.

Upvotes: 0

Views: 718

Answers (2)

Josip Domazet
Josip Domazet

Reputation: 2890

I have solved the problem by clipping away that bar using a ClipRect widget:

ClipRect(
      child: Align(
        alignment: Alignment.topCenter,
        heightFactor: 0.75,
        child: ColorPicker(
          ...
          colorPickerWidth: 250,
        ),
      ),
    );

I have not found any unwanted side effects with this approach yet.

Upvotes: 1

Developer
Developer

Reputation: 640

Here I attach some links which contains no brightnesss bar

Flutter Material Color Picker

Flex Color Picker

Upvotes: 1

Related Questions