본문 바로가기

[Flutter] 플로팅버튼 스피드다이얼로 만들기.

I'm 영서 2023. 2. 22.
반응형

 

스피드 다이얼 형식으로 플로팅 버튼 만들기. 

 

Scaffold Widget 에 입력.

      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      floatingActionButton: SpeedDial(
        animatedIcon: AnimatedIcons.menu_close,
        useRotationAnimation: true,
        animationCurve: Curves.elasticInOut,
        children: [
          SpeedDialChild(
            child: Icon(Icons.camera_alt),
            backgroundColor: Colors.grey[400],
            foregroundColor: Colors.white,
            onTap: () {
              Navigator.of(context).push(
                MaterialPageRoute(
                  builder: (context) => CameraScreen(),
                ),
              );
            },
          ),
          SpeedDialChild(
            child: Icon(Icons.add),
            backgroundColor: Colors.grey[400],
            foregroundColor: Colors.white,
            onTap: () {
              Navigator.of(context).push(
                MaterialPageRoute(
                  builder: (context) => InputScreen(),
                ),
              );
            },
          ),
          SpeedDialChild(
            child: Icon(Icons.bluetooth),
            backgroundColor: Colors.grey[400],
            foregroundColor: Colors.white,
            onTap: () {
              Navigator.of(context).push(
                MaterialPageRoute(
                  builder: (context) => BlueToothScreen(),
                ),
              );
            },
          ),
        ],
      ),
반응형

댓글