본문 바로가기

Flutter

위젯정리

AppBar

      appBar: AppBar(
        title: Text(widget.title),
        centerTitle: true,
        backgroundColor: Colors.redAccent,
        elevation: 0.0,
      ),

title : 제목

centerTitle : 글자 위치를 center로 지정 (boolean)

backgroundColor : app바의 색깔

elevation : appbar가 뜨는 정도 (소숫점 단위로도 설정가능)

Body

 Padding(padding: EdgeInsets.fromLTRB(left, top, right, bottom),)
 

내부 영역의 공간 설정 : 상하좌우를 숫자로 설정가능

        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
 

Column은 열이고 mainAxisAlignment는 축에 대해서 위치 설정을 해준다.

따라서 위의 코드는 세로 축 가운데를 뜻한다.

body 내부의 Center는 가로 방향 중간이고, Column은 세로방향 중간이라고 보면 된다.

'Flutter' 카테고리의 다른 글

Build Context와 snackbar  (0) 2023.03.20
Drawer  (0) 2023.03.20
Text style, Image 업로드  (0) 2023.03.19
플러터 프로젝트 폴더와 기본 코드 이해하기  (0) 2023.03.19
Widget  (2) 2023.03.19