[Flutter_study] Section 5~6 review
Flutter

[Flutter_study] Section 5~6 review

728x90

* 아이콘 이미지 관련 사이트

- icons8, vecteezy

: 무료 이미지 다운

- canva

: 디자인(아이콘) 만들기

 

* Hot Reload

: 새로 고침과 비슷. 저장하자마자 변경사항 확인

(control +s로 저장해도 같은 결과)

 

* Hot Restart

: 앱의 상태를 재설정

 

* StatelessWidget

: Hot Reload/Hot Restart시 이부분만 실행됨.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import 'package:flutter/material.dart';
 
void main() {
  runApp(
    MyApp()
  );
}
 
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        backgroundColor: Colors.white,
        body: Container(),
      )
    );
  }
}
 
cs

 

● Layout Widget

 

* Single-Child Layout Widget

- Container()

: 레이아웃 위젯(web의 div와 유사함)

하나의 자식만 가질 수 있음.

배경색, 패딩, 여백, 크기 지정 가능

 

* Multi-Child Layout Widget

-Column/Row

: 여러개의 자식을 가질 수 있다.

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
32
33
34
35
36
37
38
39
40
41
42
43
44
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
 
void main() {
  runApp(
    MyApp()
  );
}
 
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        backgroundColor: Colors.teal,
        body: SafeArea(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: <Widget>[
              Container(
                height: 100.0,
                width:100.0,
                color: Colors.white,
                child: Text('Container1'),
              ),
              Container(
                height: 100.0,
                width:100.0,
                color: Colors.blue,
                child: Text('Container2'),
              ),
              Container(
                height: 100.0,
                width:100.0,
                color: Colors.red,
                child: Text('Container3'),
              ),
            ],
          )
        )
      )
    );
  }
}
cs

 

 

728x90

'Flutter' 카테고리의 다른 글

[Flutter] 구글맵 API 사용하기-2  (0) 2021.05.25
[Flutter] 구글맵 API 사용하기  (0) 2021.05.24
[Flutter_study] Section 7 review  (0) 2021.05.23
[Flutter_study] Section 6 review  (0) 2021.05.18
[Flutter_study] Section 1~4 review  (0) 2021.05.15