Reputation: 1
I am trying to create a floating Action Button that expend. When the button expended I want to be able to tap or press on the icons that inside the expended FAB. I am using flutter. i am trying to add navigation to the icons. I have tried to put in the basic navigation but it seems like I am not using the create code. Please Advise
_buildOption(Icons.perm_phone_msg, 0.0),
Widget build(BuildContext context) {
return new SizedBox(
width: expandedSize,
height: expandedSize,
child: new AnimatedBuilder(
animation: _animationController,
builder: (BuildContext context, Widget child) {
return new Stack(
alignment: Alignment.center,
children: <Widget>[
_buildExpandedBackground(),
_buildOption(Icons.perm_phone_msg, 0.0),
Navigator.push(
context,
MaterialPageRoute(builder: (context)=>Lover_Page())),
_buildOption(Icons.calendar_today, -math.pi / 3),
_buildOption(Icons.assignment_ind, -2 * math.pi / 3),
_buildOption(Icons.video_call, math.pi),
_buildOption(Icons.person_add, math.pi / 3),
_buildOption(Icons.add_a_photo, 2 * math.pi / 3),
_buildFabCore(),
],
);
},
),
);
}
Upvotes: 0
Views: 71
Reputation: 7148
Just add below statement in your onTap() or onPressed() method to navigate to next screen.
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Your_Next_Screen()),
);
Also, refer Navigation-Basics
If you use widget which doesn't have any onTap() or onPressed() method. Wrap it with GestureDetector or Inkwell widget. As both widgets have default onTap() method which you can use for detecting tap events.
Upvotes: 1