Here is an example of how to create an app where you will swipe for the next item.
Here is the code from main.dart file.
import 'package:flutter/material.dart';
main(List<String> args) {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@
override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(body: MyverticalSwiper()),
);
}
}
class MyverticalSwiper extends StatelessWidget {
const MyverticalSwiper({Key? key}) : super(key: key);
@
override
Widget build(BuildContext context) {
return DefaultTabController(
length: 3,
initialIndex: 1,
child: TabBarView(
children: [
Container(
color: Colors.red,
),
Container(
color: Colors.green,
),
Container(
color: Colors.blue,
),
],
),
);
}
}
Thanks,Srikanth