We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, so I'm trying on how to show the picture on the swiper to be the first picture that I clicked on the previous page, anyone?
This is the swiper Code as i reference from here
`import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
class ImageSwiper extends StatefulWidget { @OverRide _ImageSwiperState createState() => _ImageSwiperState(); }
class _ImageSwiperState extends State {
final List imgList = [ 'assets/images/gallery/Image1.jpg', 'assets/images/gallery/Image2.jpg', 'assets/images/gallery/Image3.jpg', 'assets/images/gallery/Image4.jpg', 'assets/images/gallery/Image5.png', 'assets/images/gallery/Image6.jpg', 'assets/images/gallery/Image7.jpg', 'assets/images/gallery/Image8.jpg' ];
@OverRide Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.orange, appBar: AppBar( automaticallyImplyLeading: false, backgroundColor: Colors.white10, elevation: 0, leading: Container( padding: EdgeInsets.fromLTRB(20, 20, 0, 0), child: InkWell( child: Image.asset( 'assets/images/wp_back_button_icon.png', height: 250, ), onTap: () { Navigator.pop(context); }, ), ), ), body: Container( child: Swiper( viewportFraction: 0.8, scale: 0.9, autoplay: false, itemCount: imgList.length, itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { switch (index) { case 0: print('Image 1'); break; case 0: print('Image 2'); break; case 1: print('Image 3'); break; case 2: print('Image 4'); break; case 3: print('Image 5'); break; case 4: print('Image 6'); break; case 4: print('Image 7'); break; case 4: print('Image 8'); break; } }, child: Image.asset( imgList[index], fit: BoxFit.fitWidth, ), ); }, pagination: SwiperPagination(), ), ), ); } }`
Case is:
Many thanks, SLim
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello, so I'm trying on how to show the picture on the swiper to be the first picture that I clicked on the previous page, anyone?
This is the swiper Code as i reference from here
`import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
class ImageSwiper extends StatefulWidget {
@OverRide
_ImageSwiperState createState() => _ImageSwiperState();
}
class _ImageSwiperState extends State {
final List imgList = [
'assets/images/gallery/Image1.jpg',
'assets/images/gallery/Image2.jpg',
'assets/images/gallery/Image3.jpg',
'assets/images/gallery/Image4.jpg',
'assets/images/gallery/Image5.png',
'assets/images/gallery/Image6.jpg',
'assets/images/gallery/Image7.jpg',
'assets/images/gallery/Image8.jpg'
];
@OverRide
Widget build(BuildContext context) {
return Scaffold( backgroundColor: Colors.orange,
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: Colors.white10,
elevation: 0,
leading: Container(
padding: EdgeInsets.fromLTRB(20, 20, 0, 0),
child: InkWell(
child: Image.asset(
'assets/images/wp_back_button_icon.png',
height: 250,
),
onTap: () {
Navigator.pop(context);
},
),
),
),
body: Container(
child: Swiper(
viewportFraction: 0.8,
scale: 0.9,
autoplay: false,
itemCount: imgList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
switch (index) {
case 0:
print('Image 1');
break;
case 0:
print('Image 2');
break;
case 1:
print('Image 3');
break;
case 2:
print('Image 4');
break;
case 3:
print('Image 5');
break;
case 4:
print('Image 6');
break;
case 4:
print('Image 7');
break;
case 4:
print('Image 8');
break;
}
},
child: Image.asset(
imgList[index],
fit: BoxFit.fitWidth,
),
);
},
pagination: SwiperPagination(),
),
),
);
}
}`
Case is:
Many thanks,
SLim
The text was updated successfully, but these errors were encountered: