feat(app): 增强文字元素渲染 — 多行+字号+颜色
This commit is contained in:
@@ -146,16 +146,25 @@ class _DraggableElementState extends State<DraggableElement> {
|
|||||||
|
|
||||||
switch (element.elementType) {
|
switch (element.elementType) {
|
||||||
case ElementType.text:
|
case ElementType.text:
|
||||||
|
final text = element.content['text'] as String? ?? '';
|
||||||
|
final fontSize = (element.content['fontSize'] as num?)?.toDouble() ?? 18.0;
|
||||||
|
final fontColor = element.content['fontColor'] as String? ?? '#2D2420';
|
||||||
|
final color = _parseColor(fontColor);
|
||||||
return Container(
|
return Container(
|
||||||
color: Colors.white,
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
padding: const EdgeInsets.all(8),
|
decoration: BoxDecoration(
|
||||||
alignment: Alignment.centerLeft,
|
color: Colors.white.withValues(alpha: 0.9),
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
element.content['text'] as String? ?? '',
|
text,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: (element.content['fontSize'] as num?)?.toDouble() ?? 16,
|
fontSize: fontSize,
|
||||||
color: _parseColor(element.content['fontColor'] as String?),
|
color: color,
|
||||||
|
fontFamily: 'NotoSansSC',
|
||||||
),
|
),
|
||||||
|
maxLines: null,
|
||||||
|
softWrap: true,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user