본문 바로가기
Study/Flutter

[Flutter] floatingActionButton 플로팅 버튼 크기 설정

Small (40 x 40)

FloatingActionButton.small(
  onPressed: onPressed,
  child: Icon(Icons.edit),
)


Regular (56 x 56)

FloatingActionButton(
  onPressed: onPressed,
  child: Icon(Icons.edit),
)


Large (96 x 96)

FloatingActionButton.large(
  onPressed: onPressed,
  child: Icon(Icons.edit),
)


Extended

FloatingActionButton.extended(
  onPressed: onPressed,
  label: Text('Extended'),
  icon: Icon(Icons.edit),
)


Custom size (A x B):

SizedBox(
  width: 20,
  height: 20,
  child: FittedBox(
    child: FloatingActionButton(
      onPressed: onPressed,
      child: Icon(Icons.edit),
    ),
  ),
)

 

 

 

 

그 외에 기타 옵션과 설정은 아래 api 문서를 참고

https://api.flutter.dev/flutter/material/FloatingActionButton-class.html

 

FloatingActionButton class - material library - Dart API

A material design floating action button. A floating action button is a circular icon button that hovers over content to promote a primary action in the application. Floating action buttons are most commonly used in the Scaffold.floatingActionButton field.

api.flutter.dev