Flex와 Expanded를 가지고 쉽게 화면을 분할하는 방법을 알아보자. 위 그림은 Column : ListView : Row가 수직의 넓이를 15 : 40 : 10 비율로 나눠진 그림이다. 만약 위 처럼 화면을 분할하고 싶다면 Flex( direction: Axis.vertical, children: [ Expanded( flex: 15, child: Column( ... ), ), Expanded( flex: 40, child: ListView.separated( ... ), Expanded( flex: 10, child: Row( ... ), ), ], ), 이런식으로 코드를 짜면 간단하게 화면 분할을 할 수 있다. flex 속성으로 Expanded의 비율을 정하여 크기를 정하면 된다.
The instance member 'id' can't be accessed in an initializer. Try replacing the reference to the instance member with a different expressiondartimplicit_this_reference_in_initializer Flutter를 공부하던 중에 이와 같은 에러를 만나게 되었다. 이와 같은 에러가 난 코드를 일단 봐보자. class DetailScreen extends StatelessWidget { final String title, thumb, id; DetailScreen({ super.key, required this.title, required this.thumb, required th..