flutter_image_carousel_slider 0.0.4 flutter_image_carousel_slider: ^0.0.4 copied to clipboard
Flutter image carousel slider for smooth slide.A carousel slider in Flutter is a UI widget used to display a series of items horizontally in a scrolling manner, typically with one item visible at a ti [...]
import 'package:flutter/material.dart';
import 'package:flutter_image_carousel_slider/list_image_view.dart';
import 'package:flutter_image_carousel_slider/view_image.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Image carousel slider',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Image carousel slider'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
List<String> imageList = [];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: InkWell(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) {
return ImageListView(
imageListed: imageList,
);
}));
},
child: CardItemView(items: imageList),
),
));
}
}