111
This commit is contained in:
parent
e0d18e2e62
commit
8cefc0007b
|
|
@ -1106,7 +1106,14 @@ mixin _UpgradeDialogLogic<T extends StatefulWidget> on State<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
return RichText(
|
return RichText(
|
||||||
text: TextSpan(children: spans),
|
text: TextSpan(
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: colorScheme.onSurface.withOpacity(0.8),
|
||||||
|
height: 1.4,
|
||||||
|
),
|
||||||
|
children: spans,
|
||||||
|
),
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
);
|
);
|
||||||
|
|
@ -1141,7 +1148,6 @@ mixin _UpgradeDialogLogic<T extends StatefulWidget> on State<T> {
|
||||||
if (buffer.isEmpty) return;
|
if (buffer.isEmpty) return;
|
||||||
spans.add(TextSpan(
|
spans.add(TextSpan(
|
||||||
text: buffer.toString(),
|
text: buffer.toString(),
|
||||||
style: styles.defaultStyle,
|
|
||||||
));
|
));
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
}
|
}
|
||||||
|
|
@ -1261,9 +1267,12 @@ mixin _UpgradeDialogLogic<T extends StatefulWidget> on State<T> {
|
||||||
TextSpan _mergeTextSpanStyle(TextSpan span, TextStyle style) {
|
TextSpan _mergeTextSpanStyle(TextSpan span, TextStyle style) {
|
||||||
final mergedChildren =
|
final mergedChildren =
|
||||||
span.children?.map((child) => child is TextSpan ? _mergeTextSpanStyle(child, style) : child).toList();
|
span.children?.map((child) => child is TextSpan ? _mergeTextSpanStyle(child, style) : child).toList();
|
||||||
|
|
||||||
|
final mergedStyle = span.style != null ? style.merge(span.style) : style;
|
||||||
|
|
||||||
return TextSpan(
|
return TextSpan(
|
||||||
text: span.text,
|
text: span.text,
|
||||||
style: span.style?.merge(style) ?? style,
|
style: mergedStyle,
|
||||||
children: mergedChildren,
|
children: mergedChildren,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -2176,12 +2185,7 @@ typedef BoolCallback = void Function(bool success);
|
||||||
|
|
||||||
class _RichTextStyles {
|
class _RichTextStyles {
|
||||||
_RichTextStyles(ColorScheme colorScheme)
|
_RichTextStyles(ColorScheme colorScheme)
|
||||||
: defaultStyle = TextStyle(
|
: boldStyle = TextStyle(
|
||||||
fontSize: 13,
|
|
||||||
color: colorScheme.onSurface.withOpacity(0.8),
|
|
||||||
height: 1.4,
|
|
||||||
),
|
|
||||||
boldStyle = TextStyle(
|
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: colorScheme.onSurface.withOpacity(0.9),
|
color: colorScheme.onSurface.withOpacity(0.9),
|
||||||
height: 1.4,
|
height: 1.4,
|
||||||
|
|
@ -2207,7 +2211,6 @@ class _RichTextStyles {
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
);
|
);
|
||||||
|
|
||||||
final TextStyle defaultStyle;
|
|
||||||
final TextStyle boldStyle;
|
final TextStyle boldStyle;
|
||||||
final TextStyle italicStyle;
|
final TextStyle italicStyle;
|
||||||
final TextStyle codeStyle;
|
final TextStyle codeStyle;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue