chore: Remove horizontal scrolling for code blocks
This commit is contained in:
parent
6836cab40e
commit
c3ec0491d1
1 changed files with 9 additions and 22 deletions
|
|
@ -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,28 +379,16 @@ class HtmlMessage extends StatelessWidget {
|
||||||
selectionColor: hightlightTextColor.withAlpha(128),
|
selectionColor: hightlightTextColor.withAlpha(128),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: RawScrollbar(
|
: Padding(
|
||||||
thumbVisibility: true,
|
padding: const EdgeInsets.symmetric(
|
||||||
trackVisibility: true,
|
horizontal: 8.0,
|
||||||
controller: controller,
|
vertical: 4.0,
|
||||||
thumbColor: hightlightTextColor,
|
),
|
||||||
trackColor: hightlightTextColor.withAlpha(128),
|
child: Text.rich(
|
||||||
thickness: 8,
|
TextSpan(
|
||||||
child: SingleChildScrollView(
|
children: [_renderCodeBlockNode(element)],
|
||||||
controller: controller,
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 8.0,
|
|
||||||
vertical: 4.0,
|
|
||||||
),
|
|
||||||
child: Text.rich(
|
|
||||||
TextSpan(
|
|
||||||
children: [_renderCodeBlockNode(element)],
|
|
||||||
),
|
|
||||||
selectionColor: hightlightTextColor.withAlpha(212),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
selectionColor: hightlightTextColor.withAlpha(212),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue