Skip to content

Commit

Permalink
dynamic hero tag
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmdrz committed Oct 10, 2018
1 parent 7546cbf commit 52b204f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/pages/item-view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,26 @@ class ItemViewRoute extends StatefulWidget {

class _ItemViewRouteRoute extends State<ItemViewRoute> {
final List<CaptureModel> list;
final int index;
final String tag;
int index;
String tag;
SwiperController controller = new SwiperController();

_ItemViewRouteRoute({this.tag, this.list, this.index});

@override
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),
),
Expand Down

0 comments on commit 52b204f

Please sign in to comment.