@@ -35,9 +35,6 @@ class Carousel extends StatefulWidget {
3535 /// Count of visible cells
3636 int rowCount;
3737
38- /// Customize widget by left/right arrows
39- CarouselArrow leftArrow, rightArrow;
40-
4138 List <Widget > children;
4239
4340 /// Signature for when a pointer has contacted the screen and has begun to move.
@@ -54,8 +51,6 @@ class Carousel extends StatefulWidget {
5451 Carousel ({
5552 this .rowCount,
5653 this .children,
57- this .leftArrow,
58- this .rightArrow,
5954 this .onDragStart,
6055 this .onDrag,
6156 this .onDragEnd
@@ -96,20 +91,8 @@ class _CarouselState extends State<Carousel> with TickerProviderStateMixin {
9691
9792 new Future .delayed (Duration .zero, () {
9893 this .setState (() {
99- /// Calculate cells container width
100- CarouselArrow leftArrow = widget.leftArrow;
101- CarouselArrow rightArrow = widget.rightArrow;
10294
10395 double width = MediaQuery .of (context).size.width;
104-
105- if (leftArrow != null && leftArrow.constraints != null ) {
106- width -= leftArrow.constraints.constrainWidth ();
107- }
108-
109- if (rightArrow != null && rightArrow.constraints != null ) {
110- width -= rightArrow.constraints.constrainWidth ();
111- }
112-
11396 this .width = width;
11497 this .size = this .width / widget.rowCount;
11598 });
@@ -213,67 +196,63 @@ class _CarouselState extends State<Carousel> with TickerProviderStateMixin {
213196 child: Container (
214197 width: double .infinity,
215198 height: this .size,
216- child: Container (
217- width: this .width,
218- height: this .size,
219- child: Stack (
220- children: [
221- Positioned (
222- left: this .offset,
223- child: Row (
224- children: widget.children.map ((child) {
225- return Container (
226- width: this .size,
227- height: this .size,
228- child: child,
229- );
230- }).toList (),
231- ),
199+ child: Stack (
200+ children: [
201+ Positioned (
202+ left: this .offset,
203+ child: Row (
204+ children: widget.children.map ((child) {
205+ return Container (
206+ width: this .size,
207+ height: this .size,
208+ child: child,
209+ );
210+ }).toList (),
232211 ),
233- ]
234- ),
212+ ),
213+ ]
235214 ),
236215 ),
237216 );
238217 }
239218}
240219
241- class CarouselArrow extends Container {
242-
243- CarouselArrow ({ Key key, double width, Widget child })
244- : super (key: key, width: width, child: child);
245- }
246-
247-
248- class DefaultCarouselItem extends StatelessWidget {
249- String text;
250-
251- DefaultCarouselItem (String text) {
252- this .text = text;
253- }
254-
255- @override
256- Widget build (BuildContext context) {
257- return Container (
258- margin: EdgeInsets .all (6.0 ),
259- alignment: Alignment .center,
260- decoration: new BoxDecoration (
261- color: Colors .blue,
262- ),
263- child: Padding (
264- padding: EdgeInsets .all (6.0 ),
265- child: Column (
266- mainAxisAlignment: MainAxisAlignment .center,
267- children: < Widget > [
268- Text (
269- this .text,
270- style: TextStyle (
271- color: Colors .white
272- ),
273- ),
274- ],
275- ),
276- ),
277- );
278- }
279- }
220+ // class CarouselArrow extends Container {
221+ //
222+ // CarouselArrow({ Key key, double width, Widget child })
223+ // : super(key: key, width: width, child: child);
224+ // }
225+ //
226+ //
227+ // class DefaultCarouselItem extends StatelessWidget {
228+ // String text;
229+ //
230+ // DefaultCarouselItem(String text) {
231+ // this.text = text;
232+ // }
233+ //
234+ // @override
235+ // Widget build(BuildContext context) {
236+ // return Container(
237+ // margin: EdgeInsets.all(6.0),
238+ // alignment: Alignment.center,
239+ // decoration: new BoxDecoration(
240+ // color: Colors.blue,
241+ // ),
242+ // child: Padding(
243+ // padding: EdgeInsets.all(6.0),
244+ // child: Column(
245+ // mainAxisAlignment: MainAxisAlignment.center,
246+ // children: <Widget>[
247+ // Text(
248+ // this.text,
249+ // style: TextStyle(
250+ // color: Colors.white
251+ // ),
252+ // ),
253+ // ],
254+ // ),
255+ // ),
256+ // );
257+ // }
258+ // }
0 commit comments