Advertisement
ziobudda

Untitled

Jan 30th, 2023
1,031
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.41 KB | Source Code | 0 0
  1. List<Widget> w = [];
  2. //Prima era così
  3. //w = widget.product.images.map(.....) con un return di GestureDetector e non un w.add()
  4. widget.product.images.map(
  5.       (item) {
  6.         Widget z = GestureDetector(
  7.             child: Padding(
  8.               padding: const EdgeInsets.all(8.0),
  9.               child: Column(
  10.                 children: [
  11.                   Stack(
  12.                     children: [
  13.                       ImageNetwork(src: item.src),
  14.                       Positioned(
  15.                         child: wElevatedButton(
  16.                             onPressed: () {}, icon: Icons.delete),
  17.                         bottom: 10,
  18.                         right: 10,
  19.                       ),
  20.                       Positioned(
  21.                         child: Text("Id: ${item.iid}"),
  22.                         bottom: 10,
  23.                       ),
  24.                     ],
  25.                   ),
  26.                 ],
  27.               ),
  28.             ),
  29.             onTap: () {
  30.               index = widget.product.images.indexOf(item);
  31.               Navigator.push(
  32.                 context,
  33.                 PageTransition(
  34.                   type: PageTransitionType.rightToLeftWithFade,
  35.                   alignment: Alignment.bottomCenter,
  36.                   child: Slideshow(images: widget.product.images, page: index),
  37.                 ),
  38.               );
  39.             });
  40.         w.add(z);
  41.       },
  42.     ).toList();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement