chore: Remove horizontal scrolling for code blocks

This commit is contained in:
Christian Kußowski 2025-11-19 10:36:44 +01:00
commit c3ec0491d1
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -361,7 +361,6 @@ class HtmlMessage extends StatelessWidget {
if (element == null) { if (element == null) {
return const TextSpan(text: 'Unable to render code block!'); return const TextSpan(text: 'Unable to render code block!');
} }
final controller = isInline ? null : ScrollController();
return WidgetSpan( return WidgetSpan(
child: Material( child: Material(
@ -380,17 +379,7 @@ class HtmlMessage extends StatelessWidget {
selectionColor: hightlightTextColor.withAlpha(128), selectionColor: hightlightTextColor.withAlpha(128),
), ),
) )
: RawScrollbar( : Padding(
thumbVisibility: true,
trackVisibility: true,
controller: controller,
thumbColor: hightlightTextColor,
trackColor: hightlightTextColor.withAlpha(128),
thickness: 8,
child: SingleChildScrollView(
controller: controller,
scrollDirection: Axis.horizontal,
child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 8.0, horizontal: 8.0,
vertical: 4.0, vertical: 4.0,
@ -403,8 +392,6 @@ class HtmlMessage extends StatelessWidget {
), ),
), ),
), ),
),
),
); );
case 'img': case 'img':
final mxcUrl = Uri.tryParse(node.attributes['src'] ?? ''); final mxcUrl = Uri.tryParse(node.attributes['src'] ?? '');