diff --git a/lib/pages/item-view.dart b/lib/pages/item-view.dart index ba481b9..23a2d1e 100644 --- a/lib/pages/item-view.dart +++ b/lib/pages/item-view.dart @@ -17,8 +17,9 @@ class ItemViewRoute extends StatefulWidget { class _ItemViewRouteRoute extends State { final List list; - final int index; - final String tag; + int index; + String tag; + SwiperController controller = new SwiperController(); _ItemViewRouteRoute({this.tag, this.list, this.index}); @@ -26,9 +27,16 @@ class _ItemViewRouteRoute extends State { Widget build(BuildContext context) { return Hero( tag: tag, - child: Scaffold( + child: Scaffold( body: Container( child: Swiper( + onIndexChanged: (current) { + setState(() { + tag = list[current].uuid; + index = current; + }); + }, + controller: controller, pagination: new SwiperPagination( margin: new EdgeInsets.all(5.0), ),