带 BottomAppBar 的快速拨号

SpeedDial with BottomAppBar

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

使用 SpeedDial Widget

Here , there is a video to explain everything

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,因为 SpeedChiald 不支持我想要的多按钮集成,这是下面的代码

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),
       ),
     ),
   ),
  );
}