웹 and 앱 프로그래밍/Flutter
[Flutter]Scaffold
코딩의 숲
2022. 12. 24. 21:31
Scaffold 의기본 구성 EX)
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Sample Code'),
),
body: Center(
child: Text('You have pressed the button $_count times.'),
),
bottomNavigationBar: BottomAppBar(
child: Container(
height: 50.0,
),
),
floatingActionButton: FloatingActionButton(
onPressed: () => setState(() {
_count++;
}),
tooltip: 'Increment Counter',
child: Icon(Icons.add),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
);
}
}
AppBar:주로 창 이름을 담당
Center:가운데 영역을 의미
bottomNavigationBar:다른 창 으로 이동할 수 있는 버튼들이 있는 영역
FloatingActionButton:창 위에 떠 있는 효과를줌
FloatingActionButtonLocation:버튼의 위치 설정