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

View File

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

View File

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