본문 바로가기

Flutter-플러터

Flutter : FloatingAcionButtonLocation

반응형

The FloatingActionButtonLocation property in Flutter is used to specify the location of a FloatingActionButton widget in a Scaffold. There are several pre-defined locations available in the FloatingActionButtonLocation enum, including:

  • FloatingActionButtonLocation.centerDocked: centers the floating action button within the docked area at the bottom of the Scaffold. 
  • FloatingActionButtonLocation.endDocked: places the floating action button at the end (right) of the docked area at the bottom of the Scaffold.
  • FloatingActionButtonLocation.centerFloat: centers the floating action button in the middle of the screen, floating above other widgets.
  • FloatingActionButtonLocation.endFloat: places the floating action button at the end (right) of the screen, floating above other widgets.
  • FloatingActionButtonLocation.endTop: places the floating action button at the top-right corner of the screen, floating above other widgets.

 

minicenterDocked 와 같은 코드도 있다. 크기가 작은 사이즈이다. 

Docked는 네비게이션 바 속으로 적용되고 

Float은 기존과 같이 body 부분에 위치해 있다. 

Top은 앱바에 속으로 적용이 된다!

 

 

 

 

Here's an example of how you can use the FloatingActionButtonLocation property to place a FloatingActionButton at the end (right) of the docked area:

Scaffold(
  floatingActionButton: FloatingActionButton(
    onPressed: () { /* your code here */ },
    child: Icon(Icons.add),
  ),
  floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,
  bottomNavigationBar: BottomAppBar(
    shape: CircularNotchedRectangle(),
    child: Container(
      height: 50.0,
    ),
  ),
);
728x90
반응형

'Flutter-플러터' 카테고리의 다른 글

Flutter Getx Bindings을 쓰는 이유  (0) 2023.03.07
Flutter : DefaultTabController - 탭바 만들기...!  (0) 2023.02.08
flutter datetime 변환작업  (0) 2023.01.29
Flutter dart : Static  (0) 2023.01.18
flutter Placeholder  (0) 2023.01.16