@@ -108,13 +108,6 @@ class _GFShimmerState extends State<GFShimmer> with SingleTickerProviderStateMix
108108 angle: _controller.value * 2.0 * 22 / 7 ,
109109 child: child,
110110 ),
111- // builder: (BuildContext context, Widget child) => _GFShimmer(
112- // child: child,
113- // direction: widget.direction,
114- // gradient: widget.gradient,
115- // controllerValue: _controller.value,
116- // enabled: widget.enabled,
117- // ),
118111 );
119112
120113 @override
@@ -124,94 +117,3 @@ class _GFShimmerState extends State<GFShimmer> with SingleTickerProviderStateMix
124117 }
125118}
126119
127- //@immutable
128- //class _GFShimmer extends SingleChildRenderObjectWidget {
129- // const _GFShimmer({
130- // Widget child,
131- // this.controllerValue,
132- // this.direction,
133- // this.gradient,
134- // this.enabled,
135- // }) : super(child: child);
136- //
137- // final double controllerValue;
138- // final GFShimmerDirection direction;
139- // final Gradient gradient;
140- // final bool enabled;
141- //
142- // @override
143- // _GFShimmerFilter createRenderObject(BuildContext context) => _GFShimmerFilter(controllerValue, direction, gradient, enabled);
144- //
145- // @override
146- // void updateRenderObject(BuildContext context, _GFShimmerFilter shimmer) {
147- // shimmer.controllerValue = controllerValue;
148- // shimmer.enabled = enabled;
149- // }
150- //}
151- //
152- //class _GFShimmerFilter extends RenderProxyBox {
153- //
154- // _GFShimmerFilter(this._controllerValue, this._direction, this._gradient, this.enabled)
155- // : _gradientPaint = Paint()..blendMode = BlendMode.srcIn;
156- //
157- // final Paint _clearPaint = Paint();
158- // final Paint _gradientPaint;
159- // final Gradient _gradient;
160- // final GFShimmerDirection _direction;
161- // bool enabled;
162- // double _controllerValue;
163- // Rect _rect;
164- //
165- // @override
166- // bool get alwaysNeedsCompositing => child != null;
167- //
168- // set controllerValue(double newValue) {
169- // if (newValue == _controllerValue) {
170- // return;
171- // }
172- // _controllerValue = newValue;
173- // markNeedsPaint();
174- // }
175- //
176- // @override
177- // void paint(PaintingContext context, Offset offset) {
178- // if (child == null) {
179- // return;
180- // }
181- // assert(needsCompositing);
182- //
183- // context.canvas.saveLayer(offset & child.size, _clearPaint);
184- // context.paintChild(child, offset);
185- //
186- // final double width = child.size.width;
187- // final double height = child.size.height;
188- // Rect rect;
189- // double dx, dy;
190- // if (_direction == GFShimmerDirection.rightToLeft) {
191- // dx = _offset(width, -width, _controllerValue);
192- // dy = 0.0;
193- // rect = Rect.fromLTWH(offset.dx - width, offset.dy, 3 * width, height);
194- // } else if (_direction == GFShimmerDirection.topToBottom) {
195- // dx = 0.0;
196- // dy = _offset(-height, height, _controllerValue);
197- // rect = Rect.fromLTWH(offset.dx, offset.dy - height, width, 3 * height);
198- // } else if (_direction == GFShimmerDirection.bottomToTop) {
199- // dx = 0.0;
200- // dy = _offset(height, -height, _controllerValue);
201- // rect = Rect.fromLTWH(offset.dx, offset.dy - height, width, 3 * height);
202- // } else {
203- // dx = _offset(-width, width, _controllerValue);
204- // dy = 0.0;
205- // rect = Rect.fromLTWH(offset.dx - width, offset.dy, 3 * width, height);
206- // }
207- // if (_rect != rect) {
208- // _gradientPaint.shader = _gradient.createShader(rect);
209- // _rect = rect;
210- // }
211- // context.canvas.translate(dx, dy);
212- // context.canvas.drawRect(rect, _gradientPaint);
213- // context.canvas.restore();
214- // }
215- //
216- // double _offset(double start, double end, double controllerValue) => start + (end - start) * controllerValue;
217- //}
0 commit comments