• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

ThemeData의 accentColor속성 deprecated

21.12.26 15:30 작성 조회수 826

0

5:14에 

accentColor 속성이 이젠 deprecated 돼서 쓸 수 없다고 하는데 어떻게 해야하나요??

 

답변 2

·

답변을 작성해보세요.

0

김재기님의 프로필

김재기

2022.02.14

아무리 이렇게 코딩해도 appBar가 흰색으로 안바뀌는데요?? 머가 문제 일까요??

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

// This widget is the root of your application.
@override
Widget build(BuildContext context) {
print('MyApp created');
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primaryColor: Colors.white,
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue)
.copyWith(secondary: Colors.black),
),
home: const RootPage(),
);
}
}

HomePage의 Appbar 의 backgroundColor 값을 white로 설정하셨나요?

https://github.com/junsuk5/flutter_insta_clon/blob/null-safety/lib/home_page.dart

0

마지막 섹션에서 최신 코드로 수정하는 영상이 있습니다. 참고하시기 바라고요.

수정된 코드는 다음과 같습니다.

https://github.com/junsuk5/flutter_insta_clon/blob/null-safety/lib/main.dart

류승택님의 프로필

류승택

질문자

2021.12.27

감사합니다!