반응형
앱에 거의 필요한 요소이다.
이전에 포스팅한 내용을 가지고, 해당 사람의 정보를 리스트뷰로 보여주자.
Container(
//Listview
child: ListView(
shrinkWrap: true,
padding:const EdgeInsets.all(8),
children: [
Container(
height: 50,
color: Colors.amber[600],
child:const Center(
child:Text('11111')
)
),
Container(
height: 50,
color: Colors.amber[500],
child:const Center(
child:Text('22222')
)
),
Container(
height: 50,
color: Colors.amber[400],
child:const Center(
child:Text('33333')
)
)
],
),
)
우선 위와 같이 짤수 있다. 스크롤은 알아서 되고 미리 지정한 값이 있다면
해당 값대로 노출이된다.
결과는 아래와 같다.
근데 잘 알다 싶이, 이렇게 수동으로 값을 정의하고 리스트뷰를 사용하지 않는다.
대부분 객체를 받아서 리스트로 동적으로 표현하기 마련이다.
그럴때 방법은 다음 포스팅에 적어놓을 예정
반응형
'[Mobile] > [Flutter]' 카테고리의 다른 글
[Flutter] 위젯 별로 공통 함수로 분류하기 (0) | 2023.07.16 |
---|---|
[Flutter] 동적 리스트뷰 생성하기 (0) | 2023.07.16 |
[Flutter] 화면 이동간 데이터 전달 (0) | 2023.07.15 |
[Flutter] 플러터 화면 이동 (0) | 2023.07.15 |
[Flutter] assets에 추가하고 IOS 빌드에 추가 (0) | 2023.07.15 |