fix wrapping issues on event previews

This commit is contained in:
Henry Hiles 2026-10-05 11:16:11 -04:00
commit 66cfb0e2c6
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
5 changed files with 237 additions and 115 deletions

View file

@ -2,7 +2,8 @@ import "package:material_ui/material_ui.dart";
class const GenericEventRenderer(
final IconData icon,
final List<Widget> children, {
final List<InlineSpan> children, {
final int? maxLines,
super.key,
}) extends StatelessWidget {
@override
@ -13,7 +14,20 @@ class const GenericEventRenderer(
mainAxisSize: .min,
children: [
Padding(padding: .symmetric(horizontal: 4), child: Icon(icon)),
Flexible(child: Wrap(spacing: 4, children: children)),
Flexible(
child: Text.rich(
TextSpan(
children: [
for (final (index, child) in children.indexed) ...[
if (index > 0) TextSpan(text: " "),
child,
],
],
),
maxLines: maxLines ?? 9007199254740991,
overflow: .ellipsis,
),
),
],
),
);