You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
955 B
Dart
34 lines
955 B
Dart
|
3 years ago
|
import 'package:test_sa/views/app_style/sizing.dart';
|
||
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
import 'image_item.dart';
|
||
|
|
import 'images_viewer.dart';
|
||
|
|
class ImagesList extends StatelessWidget {
|
||
|
|
final List<String> images;
|
||
|
|
final EdgeInsets padding;
|
||
|
|
|
||
|
|
const ImagesList({Key key, this.images, this.padding}) : super(key: key);
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return ListView.builder(
|
||
|
|
padding: padding?? EdgeInsets.symmetric(horizontal: 32 * AppStyle.getScaleFactor(context)),
|
||
|
|
scrollDirection: Axis.horizontal,
|
||
|
|
itemCount: images.length,
|
||
|
|
itemBuilder: (context,itemIndex){
|
||
|
|
return ImageItem(
|
||
|
|
url: images[itemIndex],
|
||
|
|
onPressed: (){
|
||
|
|
Navigator.of(context).push(
|
||
|
|
MaterialPageRoute(builder: (_)=> ImagesViewer(
|
||
|
|
initialIndex: itemIndex,
|
||
|
|
images: images,
|
||
|
|
))
|
||
|
|
);
|
||
|
|
},
|
||
|
|
);
|
||
|
|
}
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|