반응형
Text Widget에는 overFlow라는 속성이있다.
한번 살펴보자.
/// How overflowing text should be handled.
///
/// A [TextOverflow] can be passed to [Text] and [RichText] via their
/// [Text.overflow] and [RichText.overflow] properties respectively.
enum TextOverflow {
/// Clip the overflowing text to fix its container.
clip,
/// Fade the overflowing text to transparent.
fade,
/// Use an ellipsis to indicate that the text has overflowed.
ellipsis,
/// Render overflowing text outside of its container.
visible,
}
대충 이런 속성중에서 골라 쓸 수 있다.
Text(
'[응애] 응애응애 응애 응애응애응애 응애응애 응응애응애응응애앵응애 (S/M/L)',
style: TextStyle(fontSize: 14.sp),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.justify,
maxLines: 3,
),
ellipsis 속성을 적용하면 maxLines를 넘어갈 경우 ...으로 처리가 된다.
참쉽죠?
반응형
'Flutter' 카테고리의 다른 글
flutter Google Map Marker에 이미지 파일 추가하기 (0) | 2022.07.31 |
---|---|
Could not find a file named "pubspec.yaml" When get from GitHub in Flutter (0) | 2022.06.08 |
[flutter] glassmorphism 을 사용해보자. (0) | 2021.08.18 |
[Flutter] FireStore에 대해서 알아보자 (0) | 2021.08.08 |
[Flutter] GlobalKey란 무엇인가?? (0) | 2021.08.06 |