Skip to content

Commit 91fd72e

Browse files
committed
shimmer controller added
1 parent aff5bbe commit 91fd72e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

lib/components/shimmer/gf_shimmer.dart

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class _GFShimmerState extends State<GFShimmer> with SingleTickerProviderStateMix
112112
// child: child,
113113
// direction: widget.direction,
114114
// gradient: widget.gradient,
115-
// percent: _controller.value,
115+
// controllerValue: _controller.value,
116116
// enabled: widget.enabled,
117117
// ),
118118
);
@@ -128,48 +128,48 @@ class _GFShimmerState extends State<GFShimmer> with SingleTickerProviderStateMix
128128
//class _GFShimmer extends SingleChildRenderObjectWidget {
129129
// const _GFShimmer({
130130
// Widget child,
131-
// this.percent,
131+
// this.controllerValue,
132132
// this.direction,
133133
// this.gradient,
134134
// this.enabled,
135135
// }) : super(child: child);
136136
//
137-
// final double percent;
137+
// final double controllerValue;
138138
// final GFShimmerDirection direction;
139139
// final Gradient gradient;
140140
// final bool enabled;
141141
//
142142
// @override
143-
// _GFShimmerFilter createRenderObject(BuildContext context) => _GFShimmerFilter(percent, direction, gradient, enabled);
143+
// _GFShimmerFilter createRenderObject(BuildContext context) => _GFShimmerFilter(controllerValue, direction, gradient, enabled);
144144
//
145145
// @override
146146
// void updateRenderObject(BuildContext context, _GFShimmerFilter shimmer) {
147-
// shimmer.percent = percent;
147+
// shimmer.controllerValue = controllerValue;
148148
// shimmer.enabled = enabled;
149149
// }
150150
//}
151151
//
152152
//class _GFShimmerFilter extends RenderProxyBox {
153153
//
154-
// _GFShimmerFilter(this._percent, this._direction, this._gradient, this.enabled)
154+
// _GFShimmerFilter(this._controllerValue, this._direction, this._gradient, this.enabled)
155155
// : _gradientPaint = Paint()..blendMode = BlendMode.srcIn;
156156
//
157157
// final Paint _clearPaint = Paint();
158158
// final Paint _gradientPaint;
159159
// final Gradient _gradient;
160160
// final GFShimmerDirection _direction;
161161
// bool enabled;
162-
// double _percent;
162+
// double _controllerValue;
163163
// Rect _rect;
164164
//
165165
// @override
166166
// bool get alwaysNeedsCompositing => child != null;
167167
//
168-
// set percent(double newValue) {
169-
// if (newValue == _percent) {
168+
// set controllerValue(double newValue) {
169+
// if (newValue == _controllerValue) {
170170
// return;
171171
// }
172-
// _percent = newValue;
172+
// _controllerValue = newValue;
173173
// markNeedsPaint();
174174
// }
175175
//
@@ -188,19 +188,19 @@ class _GFShimmerState extends State<GFShimmer> with SingleTickerProviderStateMix
188188
// Rect rect;
189189
// double dx, dy;
190190
// if (_direction == GFShimmerDirection.rightToLeft) {
191-
// dx = _offset(width, -width, _percent);
191+
// dx = _offset(width, -width, _controllerValue);
192192
// dy = 0.0;
193193
// rect = Rect.fromLTWH(offset.dx - width, offset.dy, 3 * width, height);
194194
// } else if (_direction == GFShimmerDirection.topToBottom) {
195195
// dx = 0.0;
196-
// dy = _offset(-height, height, _percent);
196+
// dy = _offset(-height, height, _controllerValue);
197197
// rect = Rect.fromLTWH(offset.dx, offset.dy - height, width, 3 * height);
198198
// } else if (_direction == GFShimmerDirection.bottomToTop) {
199199
// dx = 0.0;
200-
// dy = _offset(height, -height, _percent);
200+
// dy = _offset(height, -height, _controllerValue);
201201
// rect = Rect.fromLTWH(offset.dx, offset.dy - height, width, 3 * height);
202202
// } else {
203-
// dx = _offset(-width, width, _percent);
203+
// dx = _offset(-width, width, _controllerValue);
204204
// dy = 0.0;
205205
// rect = Rect.fromLTWH(offset.dx - width, offset.dy, 3 * width, height);
206206
// }
@@ -213,5 +213,5 @@ class _GFShimmerState extends State<GFShimmer> with SingleTickerProviderStateMix
213213
// context.canvas.restore();
214214
// }
215215
//
216-
// double _offset(double start, double end, double percent) => start + (end - start) * percent;
216+
// double _offset(double start, double end, double controllerValue) => start + (end - start) * controllerValue;
217217
//}

0 commit comments

Comments
 (0)