File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1+ ## 1.0.4+1
2+ - fix: vertex text style ` background ` not working.
3+
14## 1.0.4
25- feat: support specifying vertex text style.
36
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ class VertexTextRendererImpl extends VertexTextRenderer {
2121 var paragraphFontSize = vertexTextStyle? .fontSize ?? 14 ;
2222 var fontWeight = vertexTextStyle? .fontWeight ?? FontWeight .normal;
2323 var fontColor = vertexTextStyle? .color;
24+ var backgroundColor = vertexTextStyle? .backgroundColor;
2425
2526 /// 1.生成 ParagraphStyle,可设置文本的基本信息
2627 final paragraphStyle = ui.ParagraphStyle (
@@ -39,6 +40,8 @@ class VertexTextRendererImpl extends VertexTextRenderer {
3940 fontSize: fontSize,
4041 foreground: fontColor != null ? (Paint ()..color = fontColor) : paint,
4142 fontWeight: fontWeight,
43+ background:
44+ backgroundColor == null ? null : (Paint ()..color = backgroundColor),
4245 );
4346
4447 /// 3.添加样式和文字
@@ -52,7 +55,8 @@ class VertexTextRendererImpl extends VertexTextRenderer {
5255 TextPainter hpainter = TextPainter (
5356 textDirection: TextDirection .ltr,
5457 text: TextSpan (
55- style: const TextStyle (fontSize: 16 ),
58+ style:
59+ TextStyle (fontSize: paragraphFontSize + 2 , fontWeight: fontWeight),
5660 text: text,
5761 ),
5862 )..layout ();
Original file line number Diff line number Diff line change 11name : flutter_graph_view
22description : Widgets for beautiful graphic data structures, such as force-oriented diagrams.
3- version : 1.0.4
3+ version : 1.0.4+1
44repository : https://github.com/dudu-ltd/flutter_graph_view
55homepage : https://graph-cn.github.io/flutter_graph_view
66
You can’t perform that action at this time.
0 commit comments