Added color picker

This commit is contained in:
Leandro 2024-05-20 00:13:52 +02:00
parent 22aca9618e
commit dcd05b53b4
5 changed files with 42 additions and 5 deletions

View file

@ -1,8 +1,15 @@
import 'package:flutter/material.dart';
import 'package:flutter_colorpicker/flutter_colorpicker.dart';
import 'package:temperaturdecke/widgets/modal_wrapper.dart';
class AddWoolModal extends StatelessWidget {
const AddWoolModal({super.key});
AddWoolModal({super.key});
String selectedColor = "#FFFFFF";
void setSelectedColor(Color color) {
selectedColor = colorToHex(color);
}
@override
Widget build(BuildContext context) {
@ -11,6 +18,16 @@ class AddWoolModal extends StatelessWidget {
children: [
TextField(),
TextField(),
SizedBox(
height: 25,
),
ColorPicker(
displayThumbColor: false,
colorPickerWidth: 200,
enableAlpha: false,
pickerColor: Colors.black,
onColorChanged: setSelectedColor,
)
],
),
title: "Wolle hinzufügen",

View file

@ -25,6 +25,7 @@ class WoolScreen extends StatelessWidget {
floatingActionButton: FloatingActionButton(
onPressed: () {
showModalBottomSheet(
isScrollControlled: true,
showDragHandle: true,
context: context,
builder: (context) {