I want to add a condition like if someone click on Circle Avatar() image then it will be navigate to other page (suppose other page will USERPROFILE() page in my case) else someone swipe left or right then also it will be navigate to user profile() page here is the code of ontap->
actions: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 20),
child: GestureDetector(
onTap: () {Navigator.push(context,MaterialPageRoute(builder: (context) => UserProfile()));},
child: CircleAvatar(),
),
),
],
here is the code for onswipeleft->
onSwipeLeft: () {
setState(() {
Navigator.push(
context,
PageTransition(
type: PageTransitionType.rightToLeft,
child: UserProfile(),
inheritTheme: true,
ctx: context),
);
});
},
Aucun commentaire:
Enregistrer un commentaire