64 lines
1.7 KiB
Dart
64 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_hsvcolor_picker/flutter_hsvcolor_picker.dart';
|
|
import 'package:manager_app/Components/rounded_button.dart';
|
|
|
|
import '../constants.dart';
|
|
|
|
showColorPicker (Color currentColor, Function onSelect, BuildContext context) {
|
|
|
|
Color pickerColor = currentColor;
|
|
|
|
void changeColor(Color color) {
|
|
pickerColor = color;
|
|
}
|
|
|
|
showDialog(
|
|
builder: (BuildContext context) => AlertDialog(
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
|
),
|
|
content: SingleChildScrollView(
|
|
child: SizedBox(
|
|
width: 500,
|
|
height: 500,
|
|
child: ColorPicker(
|
|
color: currentColor,
|
|
onChanged: changeColor,
|
|
/*pickerColor: currentColor,
|
|
onColorChanged: changeColor,
|
|
colorPickerWidth: 300.0,
|
|
pickerAreaHeightPercent: 0.7,
|
|
enableAlpha: true,
|
|
displayThumbColor: true,
|
|
showLabel: true,
|
|
paletteType: PaletteType.hsv,
|
|
pickerAreaBorderRadius: const BorderRadius
|
|
.only(
|
|
topLeft: const Radius.circular(2.0),
|
|
topRight: const Radius.circular(2.0),
|
|
),*/
|
|
),
|
|
),
|
|
),
|
|
actions: <Widget>[
|
|
Container(
|
|
width: 180,
|
|
height: 70,
|
|
child: RoundedButton(
|
|
text: "Valider",
|
|
icon: Icons.check,
|
|
color: kSuccess,
|
|
press: () {
|
|
onSelect(pickerColor);
|
|
Navigator.of(context).pop();
|
|
},
|
|
fontSize: 20,
|
|
),
|
|
),
|
|
],
|
|
), context: context
|
|
);
|
|
}
|
|
|
|
|