I have a problem with adding options after expanding a button(app has bottomAppBar and FloatingAction).
The button works, but when I go to options and want to go to the EditDogScreen page, it does not take me there.The whole thing has been added to the buttonBar, will such a reference work? and how to change it.
I am using SpeedDial Widget for FAB
SpeedDial buildSpeedDial() {
return SpeedDial(
animatedIcon: AnimatedIcons.menu_close,
animatedIconTheme: IconThemeData(size: 22.0),
// child: Icon(Icons.add),
onOpen: () => print('OPENING DIAL'),
onClose: () => print('DIAL CLOSED'),
visible: dialVisible,
curve: Curves.bounceIn,
children: [
**SpeedDialChild(
label: 'First',
labelStyle: TextStyle(fontSize: 18.0),
backgroundColor: Colors.red,
child: GestureDetector(
onLongPress: () async {
await Navigator.of(context).pushNamed(EditDogScreen.id);
await backend.getDogs();
setState(() {});
},
child: Icon(
Icons.add,
),
),
),**
SpeedDialChild(
child: Icon(Icons.brush, color: Colors.white),
backgroundColor: Colors.green,
onTap: () => print('SECOND CHILD'),
label: 'Second Child',
labelStyle: TextStyle(fontWeight: FontWeight.w500),
labelBackgroundColor: Colors.green,
),
SpeedDialChild(
child: Icon(Icons.keyboard_voice, color: Colors.white),
backgroundColor: Colors.blue,
onTap: () => print('THIRD CHILD'),
labelWidget: Container(
color: Colors.blue,
margin: EdgeInsets.only(right: 10),
padding: EdgeInsets.all(6),
child: Text('Custom Label Widget'),
),
),
],
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
// stable top bar for all screens with bottombar
appBar: AppBar(
leading: null,
actions: <Widget>[
IconButton(
icon: Icon(Icons.close),
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => WelcomeScreen()));
}),
],
),
body: _pageOptions[_selectedPage],
bottomNavigationBar: CurvedNavigationBar(
backgroundColor: Colors.blue.withOpacity(0.7),
color: Colors.blue.withOpacity(0.5),
index: _selectedPage,
buttonBackgroundColor: Colors.white,
// backgroundColor: Colors.blue,
animationCurve: Curves.easeInOut,
animationDuration: Duration(milliseconds: 500),
onTap: (int index) {
setState(() {
_selectedPage = index;
});
},
letIndexChange: (index) => true,
items: <Widget>[
Icon(Icons.home, size: 30),
Icon(Icons.list, size: 30),
**buildSpeedDial(),**
Icon(Icons.call_split, size: 30),
Icon(Icons.perm_identity, size: 30),
],
),
);
} }