Skip to content

Commit 44e7d9b

Browse files
committed
feat: ZKNode add colorFilter and colorFilterBlendMode prop;
ZKNode add colorFilter and colorFilterBlendMode prop;
1 parent 5ede706 commit 44e7d9b

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
# 2.1.0
2+
- ZKNode add colorFilter and colorFilterBlendMode prop;
3+
- Fix any warning log
4+
15
# 2.0.1
26
- Compatible with sound null safety and the latest api
37
- Add the mounted method and call it after the user has laid out
48

9+
510
# 1.4.1
611
- Fix the issue of flutter RenderBox was not laid out in the new version
712

lib/src/node/container.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class ZKContainer extends ZKNode {
4141
}
4242

4343
void addChild(ZKNode child) {
44-
this.addChildAt(child, this.children.length);
44+
child.parent = this;
45+
this.children.add(child);
4546
}
4647

4748
void removeChild(ZKNode child) {

lib/src/node/node.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ class ZKNode {
8383
return _color;
8484
}
8585

86+
set colorFilter(ColorFilter filter) {
87+
this.paint.colorFilter = filter;
88+
}
89+
90+
BlendMode? colorFilterBlendMode;
91+
8692
set color(Color? c) {
8793
_color = c;
8894
if (c != null) this.paint.color = c;

lib/src/tween/ease.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class Elastic extends BaseEasing {
168168
var s, a = 0.1, p = 0.4;
169169
if (k == 0) return 0;
170170
if (k == 1) return 1;
171-
if (a == null || a < 1) {
171+
if (a < 1) {
172172
a = 1;
173173
s = p / 4;
174174
} else
@@ -180,7 +180,7 @@ class Elastic extends BaseEasing {
180180
var s, a = 0.1, p = 0.4;
181181
if (k == 0) return 0;
182182
if (k == 1) return 1;
183-
if (a == null || a < 1) {
183+
if (a < 1) {
184184
a = 1;
185185
s = p / 4;
186186
} else
@@ -192,7 +192,7 @@ class Elastic extends BaseEasing {
192192
var s, a = 0.1, p = 0.4;
193193
if (k == 0) return 0;
194194
if (k == 1) return 1;
195-
if (a == null || a < 1) {
195+
if (a < 1) {
196196
a = 1;
197197
s = p / 4;
198198
} else

lib/src/utils/util.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'package:flutter/services.dart';
21
import './uuid.dart';
32

43
class Util {

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.0.2
14+
version: 2.1.0
1515
homepage: https://github.com/flutterkit/zerker
1616

1717
environment:

0 commit comments

Comments
 (0)