An extended package used in RichTrex
package to pick color.
Dialog | Bottom sheet | Widget |
Add this line to your pubspec.yaml.
dependencies:
richtrex_colorpicker: ^1.1.0
First, import the package.
import 'package:richtrex_colorpicker/richtrex_colorpicker.dart';
And then put the widget like this.
RichTrexColorPicker(
color: Colors.blue,
onChanged: (color) => print(color),
);
Or if you want to open it as Dialog
, do this.
GestureDetector(
onTap: () async {
var color = await RichTrexColorPicker.openDialog(context, color: Colors.blue);
print(color);
}
);
And if you want to open it as Bottom Sheet
, try this.
GestureDetector(
onTap: () async {
var color = await RichTrexColorPicker.openBottomSheet(context, color: Colors.blue);
print(color);
}
);