feat: modify svg size

This commit is contained in:
Lucas.Xu 2022-07-29 10:38:02 +08:00
parent 7489455c20
commit e4c3a3ae84
5 changed files with 11 additions and 15 deletions

View File

@ -43,7 +43,7 @@ class BulletedListTextNodeWidget extends StatefulWidget {
class _BulletedListTextNodeWidgetState extends State<BulletedListTextNodeWidget>
with Selectable, DefaultSelectable {
final _richTextKey = GlobalKey(debugLabel: 'heading_text');
final _richTextKey = GlobalKey(debugLabel: 'bulleted_list_text');
final leftPadding = 20.0;
@override
@ -59,7 +59,8 @@ class _BulletedListTextNodeWidgetState extends State<BulletedListTextNodeWidget>
Widget build(BuildContext context) {
return Row(
children: [
const FlowySvg(
FlowySvg(
size: Size.square(leftPadding),
name: 'point',
),
FlowyRichText(

View File

@ -44,24 +44,17 @@ class CheckboxNodeWidget extends StatefulWidget {
class _CheckboxNodeWidgetState extends State<CheckboxNodeWidget>
with Selectable, DefaultSelectable {
final _checkboxKey = GlobalKey(debugLabel: 'checkbox');
final _richTextKey = GlobalKey(debugLabel: 'checkbox_text');
final leftPadding = 20.0;
@override
Selectable<StatefulWidget> get forward =>
_richTextKey.currentState as Selectable;
@override
Offset get baseOffset {
final width = _checkboxKey.currentContext
?.findRenderObject()
?.unwrapOrNull<RenderBox>()
?.size
.width;
if (width != null) {
return Offset(width, 0);
}
return Offset.zero;
return Offset(leftPadding, 0);
}
@override
@ -80,7 +73,7 @@ class _CheckboxNodeWidgetState extends State<CheckboxNodeWidget>
children: [
GestureDetector(
child: FlowySvg(
key: _checkboxKey,
size: Size.square(leftPadding),
name: check ? 'check' : 'uncheck',
),
onTap: () {

View File

@ -61,6 +61,7 @@ class _NumberListTextNodeWidgetState extends State<NumberListTextNodeWidget>
return Row(
children: [
FlowySvg(
size: Size.square(leftPadding),
number: widget.textNode.attributes.number,
),
FlowyRichText(

View File

@ -58,7 +58,8 @@ class _QuotedTextNodeWidgetState extends State<QuotedTextNodeWidget>
Widget build(BuildContext context) {
return Row(
children: [
const FlowySvg(
FlowySvg(
size: Size.square(leftPadding),
name: 'quote',
),
FlowyRichText(