mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Collapse notification cards on tap anywhere
Tapping a notification's body already toggled expand/collapse, but the action area below it wasn't tappable. Wrap the whole card in an InkWell so tapping anywhere (body or action row) toggles, while the buttons still handle their own taps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
fbd9ffd834
commit
2a6d480428
@@ -71,37 +71,39 @@ class _NotificationCardState extends State<NotificationCard> {
|
||||
padding: const EdgeInsets.only(right: Insets.lg),
|
||||
child: const Icon(Icons.done),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
widget.item.notificationType.icon,
|
||||
color: widget.item.isNew ? theme.colorScheme.primary : null,
|
||||
child: InkWell(
|
||||
onTap: () => setState(() => _expanded = !_expanded),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
widget.item.notificationType.icon,
|
||||
color: widget.item.isNew ? theme.colorScheme.primary : null,
|
||||
),
|
||||
title: Text(
|
||||
'${widget.formatter.format(widget.item.createdOn)} - ${widget.item.title}',
|
||||
style: widget.item.isNew
|
||||
? const TextStyle(fontWeight: FontWeight.bold)
|
||||
: null,
|
||||
),
|
||||
subtitle: Text(
|
||||
widget.item.body,
|
||||
maxLines: _expanded ? null : 2,
|
||||
overflow: _expanded
|
||||
? TextOverflow.visible
|
||||
: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
'${widget.formatter.format(widget.item.createdOn)} - ${widget.item.title}',
|
||||
style: widget.item.isNew
|
||||
? const TextStyle(fontWeight: FontWeight.bold)
|
||||
: null,
|
||||
AnimatedSize(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeInOut,
|
||||
child: _expanded
|
||||
? _buildActions(context)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
subtitle: Text(
|
||||
widget.item.body,
|
||||
maxLines: _expanded ? null : 2,
|
||||
overflow: _expanded
|
||||
? TextOverflow.visible
|
||||
: TextOverflow.ellipsis,
|
||||
),
|
||||
onTap: () => setState(() => _expanded = !_expanded),
|
||||
),
|
||||
AnimatedSize(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
curve: Curves.easeInOut,
|
||||
child: _expanded
|
||||
? _buildActions(context)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user