문제
Row 로 감싸져 있는 Text 의 개수가 많아져 화면의 크기보다 넘어갈 때 발생한다.
Row(
children: [
Text('ProductImage'),
Text('ProductImage'),
Text('ProductImage'),
Text('ProductImage'),
Text('ProductImage'),
],
)
해결
나는 옆으로 스크롤하길 원했기 때문에 SingleChildScrollView 사용할 수 있다.
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
Text('ProductImage'),
Text('ProductImage'),
Text('ProductImage'),
Text('ProductImage'),
Text('ProductImage'),
],
),
);
다른 해결
내가 원하는 동작은 아니지만 row 길이가 길어졌을 때 한 화면을 보고싶다면 Row 대신 Wrap 을 사용하는 방법도 있다.
Wrap(
children: [
Text('ProductImage'),
Text('ProductImage'),
Text('ProductImage'),
Text('ProductImage'),
Text('ProductImage'),
],
)
'에러 해결방법' 카테고리의 다른 글
[에러] firebase 연동 중에 발생한 오류 (0) | 2024.11.29 |
---|---|
[트러블슈팅] ListView 안에 ListeView(Feat. CustomScrollView) (0) | 2024.11.26 |
[트러블슈팅] Flutter 앱 구현에 있어서 나타났던 트러블슈팅 (0) | 2024.11.19 |
[에러] type 'List<String>' is not a subtype of type 'Set<String>' of 'function result' (1) | 2024.11.16 |
[트러블슈팅] Unhandled exception: LateInitializationError: Field '___' has not been initialized.(Feat. Dart 비동기처리) (0) | 2024.11.07 |
댓글