-
[Flutter] 모든 페이지에 theme 을 설정하는 방법함께 공부하는 Flutter 2023. 4. 9. 14:17반응형
main.dart에서 theme: ThemeData 설정하기
main.dart 의 theme 에서 모든 테마를 세팅해주면,
개발할때마다 페이지 내부에서 동일핝 세팅을 해줄 필요가 없습니다.예시
Widget build(BuildContext context) { return MaterialApp( title: 'TestApp', theme: ThemeData( primaryColor: const Color(0xFFE9435A), scaffoldBackgroundColor: Colors.white, appBarTheme: const AppBarTheme( foregroundColor: Colors.black, backgroundColor: Colors.white, elevation: 0, titleTextStyle: TextStyle( color: Colors.black, fontSize: 16, fontWeight: FontWeight.w600, ), ), ), home: const SignUpScreen(), ); }
반응형'함께 공부하는 Flutter' 카테고리의 다른 글
[Flutter] TextField() 에서 키보드 타입 변경하는 옵션 (0) 2023.04.23 [Flutter] 변수에서 final의 의미 (0) 2023.04.23 [Flutter] 메모리 관리 (0) 2023.04.23 [Flutter] initState() 에서 super.initState()를 호출해야 하는 이유 (0) 2023.04.09 [Flutter] @override 란? (0) 2023.04.09