inflearn logo
Khóa học

Khóa học

Chia sẻ kiến thức

Bài viết của zbqlr456

zbqlr456 zbqlr456

@zbqlr456

Số lượng đánh giá đã viết
3
Xếp hạng trung bình
5.0

Bài viết 1

Hỏi & Đáp

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로 만들 수는 있습니다.

Lượt thích
1
Số bình luận
2
Lượt xem
872