Notice
Recent Posts
Recent Comments
Link
«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

coding etude

[widget] Drawer(네비게이션 바) 본문

Flutter(Dart)

[widget] Drawer(네비게이션 바)

코코리니 2022. 10. 5. 17:20

사이드 네비게이션 바 

엣지부분을 드레그해서 사용 할수 있다

Scaffold(
	drawer: Drawer( // endDrawer: 오른쪽에서 왼쪽으로 열림
    	child: ListView(
        	children: [
            	DrawerHeader(...),
                ListWidget(...),
                ListWidget(...)
            ]
        )
    )
)

AppBar 자체적으로 오픈 시킬 수 있다.

Scaffold(
	appBar: AppBar(
    	.
        .
        leading: IconButton(
        	onPressed:(){
            	Scaffold.of(context).openDrawer(); // openEndDrawer();
            }
        )
    )
)

drawer
endDrawer

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

 

Drawer class - material library - Dart API

A Material Design panel that slides in horizontally from the edge of a Scaffold to show navigation links in an application. Drawers are typically used with the Scaffold.drawer property. The child of the drawer is usually a ListView whose first child is a D

api.flutter.dev