Task edit #37

Open
konrad wants to merge 76 commits from feature/edit-task into master
3 changed files with 13 additions and 5 deletions
Showing only changes of commit f6d500f45e - Show all commits

View File

@ -16,21 +16,25 @@ class LabelComponent extends StatefulWidget {
}
class LabelComponentState extends State<LabelComponent> {
@override
Widget build(BuildContext context) {
Color backgroundColor = widget.label.color ?? vLabelDefaultColor;
Color textColor = backgroundColor.computeLuminance() > 0.5 ? vLabelDark : vLabelLight;
return Chip(
label: Text(
widget.label.title,
style: TextStyle(
color: vWhite,
color: textColor ,
),
),
backgroundColor: vGreen,
backgroundColor: backgroundColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(3)),
),
onDeleted: widget.onDelete,
deleteIconColor: vWhite,
deleteIconColor: textColor,
deleteIcon: Container(
padding: EdgeInsets.all(3),
decoration: BoxDecoration(
@ -39,7 +43,7 @@ class LabelComponentState extends State<LabelComponent> {
),
child: Icon(
Icons.close,
color: vWhite,
color: textColor,
size: 15,
),
),

View File

@ -233,7 +233,7 @@ class _TaskEditPageState extends State<TaskEditPage> {
spacing: 10,
children: <Widget>[
LabelComponent(
label: Label(id: 12134, title: 'Lorem Ipsum'),
label: Label(id: 12134, title: 'Lorem Ipsum', color: Color(0xFFe8e8e8)),
onDelete: () {
print('deleted');
},

View File

@ -18,6 +18,10 @@ const vButtonColor = vPrimary;
const vButtonTextColor = vWhite;
const vButtonShadow = Color(0xFFb2d9ff);
const vLabelLight = Color(0xFFe5e5e5);
const vLabelDark = Color(0xFF4a4a4a);
const vLabelDefaultColor = vGreen;
///////////
// Paddings
////////