Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- this()
- stateful widget 생명주기
- 참조형 매개변수
- 클래스 변수
- 운영체제의 분류
- 운영체제의 구조
- static import문
- 객체 배열
- 오버라이딩과 오버로딩 차이점
- stateful widget
- PriorityQueue
- 운영체제의 목적
- 호출스택
- 조상의 생성자
- 운영체제란 무엇인가
- 오버로딩
- webview_flutter
- 이것이코딩테스트다
- object클래스
- FLUTTER
- 명예의전당(1)
- 인스턴스 메서드
- 프로그래머스
- stateless widget
- 초기화 순서
- this()와 참조변수 this 차이점
- 기본형 매개변수
- static 메서드
- 참조형 반환타입
- 운영체제의 예
Archives
- Today
- Total
Coram Deo
[Flutter] - Theme을 이용한 화면 배경색 설정하기 본문
1. main.dart의 build 메서드 안에 theme에 색깔을 미리 작성해놓는다.
- theme: ThemeData(
scaffoldBackgroundColor: const Color(0xFFe64d3d),
),
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
scaffoldBackgroundColor: const Color(0xFFe64d3d),
),
home: const HomeScreen(),
);
}
2. home_screen.dart 의 build 메서드 안에 배경색을 지정한다.
- backgroundColor: Theme.of(context).scaffoldBackgroundColor,
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: const Column(
children: [
Text(
"POMOTIMER",
style: TextStyle(
color: Colors.white,
),
),
],
),
);
}
'Flutter' 카테고리의 다른 글
[Flutter] API 데이터 가져오기 (Data Fetching / fromJson) (1) | 2024.07.02 |
---|---|
[Flutter] 새로 배운 개념들 - SafeArea / EdgeInsets / ListView.builder (shrinkWrap) (0) | 2024.06.19 |
[Flutter] inner 패딩으로 인해 Text 정렬이 안될 때, 설정하는 법 (0) | 2024.06.12 |
[Flutter] 이미지 넣기 / 이미지 크기 조절하기 / 둥글게 만들기 (0) | 2024.06.12 |
[Flutter] Stateful Widget - setState (0) | 2024.06.01 |