Scaffold(
appBar: AppBar(
title: const Text('FloatingActionButton Sample'),
),
body: const Center(child: Text('Press the button below!')),
floatingActionButton: FloatingActionButton(
onPressed: () {
// Add your onPressed code here!
},
backgroundColor: Colors.green,
child: const Icon(Icons.navigation),
),
);
- 머터리얼 디자인 플로팅 액션 버튼
- 하단탭이 있는 경우 플러터에 fab도 끼워넣을 수 있는데 아래와 같은 코드를 사용하면 된다
Scaffold(
floatingActionButton : ...
bottomNavigationBar : BottomAppBar
color:Colors.yellow,
child : Container(height:50.0),
floationgActionButtonLocation : FloatingActionButtonLocatiopn.endDocked,
),
)
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
'기초다지기 > Flutter&Dart' 카테고리의 다른 글
flutter 비동기 위젯 FutureBuilder, StreamBuilder (0) | 2023.06.03 |
---|---|
flutter splash 화면 구현하기 (0) | 2023.05.31 |
Flutter Widget LinearGradient (0) | 2023.05.22 |
Flutter Provider? (0) | 2023.05.21 |
flutter hasSize Colume ListView error (0) | 2023.05.13 |