-
카테고리
-
세부 분야
모바일 앱 개발
-
해결 여부
미해결
ThemeData 미적용
22.02.07 17:08 작성 조회수 370
0
- 먼저 유사한 질문이 있었는지 검색해보세요.
- 서로 예의를 지키며 존중하는 문화를 만들어가요.
- 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
답변을 작성해보세요.
0
오준석
지식공유자2022.02.07
어두운 테마를 원하시는 거라면 canvasColor로 배경색을 textTheme에서 글자 색상을 조절하는 방법이 있습니다. 앱바는 appBarTheme 속성을 수정해야 하고 ThemeData에는 엄청 많은 여러 테마를 따로 설정하도록 되어 있습니다. 샘플코드를 제시해 드릴테니 참고하세요.
theme: ThemeData(
unselectedWidgetColor: Colors.white,
canvasColor: darkGray,
floatingActionButtonTheme:
Theme.of(context).floatingActionButtonTheme.copyWith(
backgroundColor: Colors.white,
foregroundColor: darkGray,
),
appBarTheme: Theme.of(context).appBarTheme.copyWith(
backgroundColor: darkGray,
),
textTheme: Theme.of(context).textTheme.apply(
bodyColor: Colors.white,
),
)
답변 1