fix wrapping issues on event previews
This commit is contained in:
parent
02c486e1b3
commit
66cfb0e2c6
5 changed files with 237 additions and 115 deletions
|
|
@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue