inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

김응철님의 게시글

김응철 김응철

@zbqlr456

수강평 작성수
3
평균평점
5.0

게시글 1

질문&답변

AppBar 의 경우 CLASS 로 만들지 않고 함수로 만드는 이유가 뭔가요?

class _RenderAppBar extends StatelessWidget implements PreferredSizeWidget{ final AppBar appBar; const _RenderAppBar({super.key, required this.appBar}); @override Widget build(BuildContext context) { return AppBar( title: Text( '오늘도 출근', style: TextStyle( color: Colors.blue, fontWeight: FontWeight.w700, ), ), backgroundColor: Colors.white, );; } @override Size get preferredSize => Size.fromHeight(appBar.preferredSize.height); } 추가로 꼭 CLASS로 만들고 싶으시다면 이런 형태로 직접 상속받아 CLASS로 만들 수는 있습니다.

좋아요수
1
댓글수
2
조회수
870