carousel_images 1.1.1 carousel_images: ^1.1.1 copied to clipboard
Carousel of images with reality (parallax) effect. Support Network and Asset Images.
import 'package:flutter/material.dart';
import 'package:carousel_images/carousel_images.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(),
);
}
}
class HomePage extends StatelessWidget {
final List<String> listImages = [
'assets/1.jpg',
'https://www.factroom.ru/wp-content/uploads/2019/04/5-osobennostej-klimata-pitera-o-kotoryh-vy-dolzhny-znat-esli-sobiraetes-syuda-priekhat.jpg',
'https://cdn.flixbus.de/2018-01/munich-header-d8_0.jpg',
'assets/4.jpg',
'assets/5.jpg',
];
@override
Widget build(BuildContext context) {
return Material(
color: Colors.white,
child: Column(
children: <Widget>[
SizedBox(height: 100),
CarouselImages(
scaleFactor: 0.7,
listImages: listImages,
height: 300.0,
borderRadius: 30.0,
cachedNetworkImage: true,
verticalAlignment: Alignment.bottomCenter,
onTap: (index) {
print('Tapped on page $index');
},
)
],
),
);
}
}