Improve event todo visibility
This commit is contained in:
@@ -915,6 +915,26 @@ class WeekEventPill extends StatelessWidget {
|
|||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (event.hasTodos) ...[
|
||||||
|
const SizedBox(height: 2),
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.task_alt_rounded, color: sage, size: 12),
|
||||||
|
const SizedBox(width: 3),
|
||||||
|
Text(
|
||||||
|
event.todos.isEmpty
|
||||||
|
? 'teend\u0151'
|
||||||
|
: '${event.todos.length} db',
|
||||||
|
style: const TextStyle(
|
||||||
|
color: sage,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight: FontWeight.w900,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
const SizedBox(height: 1),
|
const SizedBox(height: 1),
|
||||||
Text(
|
Text(
|
||||||
event.title,
|
event.title,
|
||||||
@@ -1424,7 +1444,15 @@ class EventCard extends StatelessWidget {
|
|||||||
style: const TextStyle(color: Colors.black54),
|
style: const TextStyle(color: Colors.black54),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
|
Wrap(
|
||||||
|
spacing: 6,
|
||||||
|
runSpacing: 6,
|
||||||
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
|
children: [
|
||||||
AudienceChip(person: person, event: event),
|
AudienceChip(person: person, event: event),
|
||||||
|
if (event.hasTodos) TodoBadge(event: event),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1440,6 +1468,40 @@ class EventCard extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class TodoBadge extends StatelessWidget {
|
||||||
|
const TodoBadge({super.key, required this.event});
|
||||||
|
|
||||||
|
final CalendarEvent event;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final count = event.todos.length;
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 9, vertical: 5),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: sage.withValues(alpha: .12),
|
||||||
|
borderRadius: BorderRadius.circular(999),
|
||||||
|
border: Border.all(color: sage.withValues(alpha: .18)),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.task_alt_rounded, color: sage, size: 14),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Text(
|
||||||
|
count == 0 ? 'Teend\u0151 van' : '$count teend\u0151',
|
||||||
|
style: const TextStyle(
|
||||||
|
color: sage,
|
||||||
|
fontWeight: FontWeight.w900,
|
||||||
|
fontSize: 11,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class FamilyAvatar extends StatelessWidget {
|
class FamilyAvatar extends StatelessWidget {
|
||||||
const FamilyAvatar({super.key, required this.person, this.radius = 22});
|
const FamilyAvatar({super.key, required this.person, this.radius = 22});
|
||||||
|
|
||||||
|
|||||||
+102
-7
@@ -310,15 +310,106 @@ class _EventAddDialogState extends State<EventAddDialog> {
|
|||||||
maxLines: 4,
|
maxLines: 4,
|
||||||
decoration: const InputDecoration(labelText: 'Megjegyz\u00e9s'),
|
decoration: const InputDecoration(labelText: 'Megjegyz\u00e9s'),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 12),
|
||||||
CheckboxListTile(
|
InkWell(
|
||||||
contentPadding: EdgeInsets.zero,
|
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,
|
value: hasTodos,
|
||||||
onChanged: (value) => setState(() => hasTodos = value ?? false),
|
activeThumbColor: sage,
|
||||||
title: const Text('Teend\u0151 van'),
|
onChanged: (value) => setState(() => hasTodos = value),
|
||||||
controlAffinity: ListTileControlAffinity.leading,
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
if (hasTodos) ...[
|
if (hasTodos) ...[
|
||||||
|
const SizedBox(height: 12),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -591,7 +682,11 @@ class _StockAddDialogState extends State<StockAddDialog> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AlertDialog(
|
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(
|
content: SizedBox(
|
||||||
width: 420,
|
width: 420,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
Reference in New Issue
Block a user