build method
계산된 최소 높이 안에 스크롤 가능한 child를 빌드한다.
Implementation
@override
Widget build(BuildContext context) {
return ConstrainedBox(
constraints: BoxConstraints(
minHeight:
MediaQuery.of(context).size.height -
(useSafeArea ? MediaQuery.of(context).padding.vertical : 0) -
(useAppBar ? kToolbarHeight : 0) -
(useBottomNavigationBar ? kBottomNavigationBarHeight : 0) -
preferredSizeWidgets.fold(
0,
(sum, widget) => sum + (widget.preferredSize.height),
),
),
child: SingleChildScrollView(
controller: controller,
padding: padding,
child: SizedBox(width: double.infinity, child: child),
),
);
}