How to open new screen by swiping to the right of listview
item similar to as snapchat
app. This is the video link that i want to achieve this.
link
I tried to check with listview slidable but there is no option for navigating to new screen.
Below is the sample dart code of two screens. By swiping right of listview
item i want to open TestPage.dart
screen. How to achieve this in Flutter?
FirstPage.dart
ListView.builder(
itemCount: 10,
shrinkWrap: true,
scrollDirection: Axis.vertical,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
ClipOval(
child: Image.network(
'https://googleflutter.com/sample_image.jpg',
width: 50,
height: 50,
fit: BoxFit.cover,
),
),
Padding(
padding: const EdgeInsets.only(
right: 10.0),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
'Person 1',
style: TextStyle(
color: Colors.red
),
),
const FittedBox(
fit: BoxFit.fitWidth,
child: Text(
'last seen at 8:22 PM'
)
],
),
Padding(
padding: const EdgeInsets.only(
top: 5.0),
child: SizedBox(
width: MediaQuery.of(context)
.size
.width *
0.50,
child:Text('test'),
),
)
],
),
),],),],),);}),
TestPage.dart
class TestPage extends StatefulWidget {
const TestPage({Key? key}) : super(key: key);
@override
State<TestPage> createState() => _TestPageState();
}
class _TestPageState extends State<TestPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.redAccent,
body: Container(),
);
}
}