Flutter Box
오늘 새롭게 알게된 내용
1. 박스의 폭을 % 로 설정하려면 Flexible()로 감싸주어야한다.
2. Row()안에서 박스하나만 꽉 채우고싶을때는 Expanded 를 사용한다.
=> 박스폭을 % 로 주고싶으면 Flexible / 박스 하나를 넓게 채우려면 Expanded
body: Container(
height: 150,
padding: EdgeInsets.all(20),
child: Row(
children: [
Image.asset(
'assets/도로로.jpg',
width: 150,
),
Container(
width: 200,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('카메라 팝니다.'),
Text('강동역 2번출구'),
Text('100,000원'),
Row(
// 처음에 끝으로 정렬하려고했으나 잘 안되었음
// 이유는 Row 의 크기가 작아서였고
// Container 의 width 을 150으로 하였을때 해결되었음
mainAxisAlignment: MainAxisAlignment.end,
children: [
Icon(Icons.favorite),
Text('4'),
],
)
],
),
)
],
),
),