Flutter material 3 적용 이후 FAB 모양 변경

IT&프로그래밍 2023. 12. 8. 16:18

material 3 이후 디자인이 변경된 부분 중 FAB(Floating Action Button)의 모양이 동그란 원 모양에서 각진 원 모양으로 변경이 되었습니다.

 

그래서 앱 만들때 기본으로 둥근사각형 모양의 버튼의 디자인이 만들어 지는데요.

M2처럼 동그란 원 모양의 FAB모양을 원하시면

shape: const CircleBorder(),

이걸 넣어 주시면 됩니다.

예)

return FloatingActionButton(
  shape: const CircleBorder(),
  heroTag: "chatFab",
  backgroundColor: CustomColors.of(context).primary,
  child: const Icon(Icons.add),
  onPressed: () {...
  .
  .

 

위와같이 변경된 모양을 확인 하실수 있습니다.

 

플러터커뮤니티사이트 : https://flutterdev.kr