Improve event todo visibility

This commit is contained in:
zsolt
2026-08-13 14:07:22 +02:00
parent e56abfb2aa
commit f13353f4ee
2 changed files with 166 additions and 9 deletions
+103 -8
View File
@@ -310,15 +310,106 @@ class _EventAddDialogState extends State<EventAddDialog> {
maxLines: 4,
decoration: const InputDecoration(labelText: 'Megjegyz\u00e9s'),
),
const SizedBox(height: 8),
CheckboxListTile(
contentPadding: EdgeInsets.zero,
value: hasTodos,
onChanged: (value) => setState(() => hasTodos = value ?? false),
title: const Text('Teend\u0151 van'),
controlAffinity: ListTileControlAffinity.leading,
const SizedBox(height: 12),
InkWell(
borderRadius: BorderRadius.circular(18),
onTap: () => setState(() => hasTodos = !hasTodos),
child: AnimatedContainer(
duration: const Duration(milliseconds: 180),
padding: const EdgeInsets.all(14),
decoration: BoxDecoration(
color: hasTodos ? mint : const Color(0xFFF4F4F1),
borderRadius: BorderRadius.circular(18),
border: Border.all(
color: hasTodos
? sage.withValues(alpha: .55)
: Colors.black.withValues(alpha: .08),
width: hasTodos ? 1.4 : 1,
),
),
child: Row(
children: [
Container(
width: 38,
height: 38,
decoration: BoxDecoration(
color: hasTodos ? sage : Colors.white,
borderRadius: BorderRadius.circular(14),
border: Border.all(
color: sage.withValues(alpha: .18),
),
),
child: Icon(
hasTodos
? Icons.task_alt_rounded
: Icons.add_task_outlined,
color: hasTodos ? Colors.white : sage,
size: 21,
),
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
const Expanded(
child: Text(
'Teend\u0151 van az esem\u00e9nyn\u00e9l',
style: TextStyle(
color: ink,
fontWeight: FontWeight.w900,
fontSize: 15,
),
),
),
if (todos.isNotEmpty)
Container(
padding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 3,
),
decoration: BoxDecoration(
color: sage.withValues(alpha: .12),
borderRadius: BorderRadius.circular(999),
),
child: Text(
'${todos.length} db',
style: const TextStyle(
color: sage,
fontWeight: FontWeight.w900,
fontSize: 11,
),
),
),
],
),
const SizedBox(height: 3),
Text(
hasTodos
? 'Add meg, mit kell elint\u00e9zni ehhez az esem\u00e9nyhez.'
: 'Kapcsold be, ha az esem\u00e9nyhez feladatlista tartozik.',
style: const TextStyle(
color: Colors.black54,
fontSize: 12.5,
),
),
],
),
),
const SizedBox(width: 8),
Switch(
value: hasTodos,
activeThumbColor: sage,
onChanged: (value) => setState(() => hasTodos = value),
),
],
),
),
),
if (hasTodos) ...[
const SizedBox(height: 12),
Row(
children: [
Expanded(
@@ -591,7 +682,11 @@ class _StockAddDialogState extends State<StockAddDialog> {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text(editing ? 'K\u00e9szlet szerkeszt\u00e9se' : 'K\u00e9szlet felv\u00e9tele'),
title: Text(
editing
? 'K\u00e9szlet szerkeszt\u00e9se'
: 'K\u00e9szlet felv\u00e9tele',
),
content: SizedBox(
width: 420,
child: Column(