mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: customizes quoted text style
This commit is contained in:
parent
59838f5845
commit
25387cd0b0
@ -18,12 +18,14 @@ class FlowySvg extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
return SvgPicture.asset(
|
return SizedBox.fromSize(
|
||||||
'assets/images/$name.svg',
|
size: size,
|
||||||
color: color,
|
child: SvgPicture.asset(
|
||||||
package: 'flowy_editor',
|
'assets/images/$name.svg',
|
||||||
width: size.width,
|
color: color,
|
||||||
height: size.width,
|
package: 'flowy_editor',
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
} else if (number != null) {
|
} else if (number != null) {
|
||||||
final numberText =
|
final numberText =
|
||||||
|
@ -158,6 +158,7 @@ class _FlowyRichTextState extends State<FlowyRichText> with Selectable {
|
|||||||
color: widget.textNode.toRawString().isNotEmpty
|
color: widget.textNode.toRawString().isNotEmpty
|
||||||
? Colors.transparent
|
? Colors.transparent
|
||||||
: Colors.grey,
|
: Colors.grey,
|
||||||
|
fontSize: baseFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -59,7 +59,10 @@ class _QuotedTextNodeWidgetState extends State<QuotedTextNodeWidget>
|
|||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
FlowySvg(
|
FlowySvg(
|
||||||
size: Size.square(leftPadding),
|
size: Size(
|
||||||
|
leftPadding,
|
||||||
|
_quoteHeight,
|
||||||
|
),
|
||||||
name: 'quote',
|
name: 'quote',
|
||||||
),
|
),
|
||||||
FlowyRichText(
|
FlowyRichText(
|
||||||
@ -71,4 +74,10 @@ class _QuotedTextNodeWidgetState extends State<QuotedTextNodeWidget>
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double get _quoteHeight {
|
||||||
|
final lines =
|
||||||
|
widget.textNode.toRawString().characters.where((c) => c == '\n').length;
|
||||||
|
return (lines + 1) * leftPadding;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user