Skip to content

Commit e2c9e5a

Browse files
committed
feat: ZKText add merge style method
1 parent 2e99ea5 commit e2c9e5a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/src/node/text.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ class ZKText extends ZKNode {
8282
this.setText(this.text);
8383
}
8484

85+
TextPainter? get painter() {
86+
return _painter;
87+
}
88+
8589
////////////////////////////////////////////////////////////
8690
///
8791
/// Set the style of the derivative method
@@ -113,7 +117,7 @@ class ZKText extends ZKNode {
113117
String? ellipsis,
114118
StrutStyle? strutStyle,
115119
TextWidthBasis textWidthBasis: TextWidthBasis.parent}) {
116-
_style = TextStyle(
120+
_style = _style?.merge(TextStyle(
117121
inherit: inherit,
118122
color: color,
119123
backgroundColor: backgroundColor,
@@ -129,7 +133,7 @@ class ZKText extends ZKNode {
129133
decorationColor: decorationColor,
130134
decorationStyle: decorationStyle,
131135
decorationThickness: decorationThickness,
132-
);
136+
));
133137

134138
this.setPainterStyle(
135139
textAlign: textAlign,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: Zerker is a flexible and lightweight flutter canvas graphic animati
1111
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1212
# Read more about iOS versioning at
1313
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14-
version: 2.2.1
14+
version: 2.2.2
1515
homepage: https://github.com/flutterkit/zerker
1616

1717
environment:

0 commit comments

Comments
 (0)