快速拨号与底部appbar



你好朋友们,我正在开发一个应用程序,这个应用程序有bottomAppBar和FloatingAction嵌入在bottomAppBar。当我将位置SpeedDial Widget设置为centerDocker时,然后按下按钮,它开始默认位置,这是第一个创建的注意:我正在使用FAB快速拨号小部件

在这里,有一个视频来解释这一切

floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: mySpeedDial(),

SpeedDial mySpeedDial() {
return SpeedDial(
curve: Curves.bounceIn,
elevation: 20,
icon: Icons.add,
buttonSize: 75,
backgroundColor: Colors.white,
closeManually: false,
visible: true,
overlayOpacity: 0,
iconTheme: IconThemeData(
color: Colors.black,
),
children: [
SpeedDialChild(
child: Icon(
Icons.camera_alt_sharp,
color: Colors.black,
),
backgroundColor: Colors.white,
onTap: () {
print("tapped");
kameradanFotograf().then((value) {
if (dosya != null) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => yuklemeSayfasi(
kullanici: anlikKullanici,
dosya: dosya,
)));
} else {
sayfaKontrol.jumpToPage(0);
}
});
//displayUploadScreen();
}),
SpeedDialChild(
child: Icon(
Icons.add_photo_alternate,
color: Colors.black,
),
backgroundColor: Colors.white,
onTap: () {
print("tapped");
galeridenFotograf().then((value) {
if (dosya != null) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => yuklemeSayfasi(
kullanici: anlikKullanici,
dosya: dosya,
)));
} else {
sayfaKontrol.jumpToPage(0);
}
});
//displayUploadScreen();
}),
],
);

}

我已经将SpeedDialChild更改为FloatingActionButton,因为speedchild不支持多按钮集成,这里是下面的代码

Widget butonKamera() {
return Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color(0x540000000),
spreadRadius: 2,
blurRadius: 65,
),
],
),
child: FloatingActionButton(
heroTag: "1",
backgroundColor: Colors.white,
mini: true,
onPressed: () {
print("tapped");
kameradanFotograf().then((value) {
// ignore: unnecessary_null_comparison
if (dosya != null) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => yuklemeSayfasi(
kullanici: anlikKullanici,
dosya: dosya,
)));
} else {
sayfaKontrol!.jumpToPage(0);
}
});
},
tooltip: "kamera",
child: Icon(Icons.camera_alt_sharp),
),
);
}
Widget butonGaleri() {
return Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color(0x540000000),
spreadRadius: 2,
blurRadius: 65,
),
],
),
child: FloatingActionButton(
heroTag: "2",
mini: true,
backgroundColor: Colors.white,
onPressed: () {
print("tapped");
galeridenFotograf().then((value) {
// ignore: unnecessary_null_comparison
if (dosya != null) {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => yuklemeSayfasi(
kullanici: anlikKullanici,
dosya: dosya,
)));
} else {
sayfaKontrol!.jumpToPage(0);
}
});
},
tooltip: "galeri",
child: Icon(Icons.add_photo_alternate_rounded),
),
);
}
Widget butonEkleme() {
return Container(
width: 70,
height: 70,
child: FloatingActionButton(
//BeveledRectangleBorder(borderRadius: 
BorderRadius.all(Radius.circular(45.0))),
heroTag: "3",
backgroundColor: Colors.white,
onPressed: animate,
tooltip: "ekleme",
child: Container(
padding: EdgeInsets.zero,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
image: DecorationImage(image: AssetImage("assets/images/sscard.png"), 
fit: BoxFit.fill),
),
),
),
);
}

最新更新