Flutter

이미지 모서리 둥글게 만들기 - ClipRRect

Michelle Hwang 2021. 12. 14. 12:02

https://api.flutter.dev/flutter/widgets/ClipRRect-class.html

 

ClipRRect class - widgets library - Dart API

A widget that clips its child using a rounded rectangle. By default, ClipRRect uses its own bounds as the base rectangle for the clip, but the size and location of the clip can be customized using a custom clipper. See also: CustomClipper, for information

api.flutter.dev

R은 Round 입니다. 위젯에 shape나 decoration 속성이 없으면 ClipRRct를 이용하여 모서리를 둥글게 만들거나 모양을 줄 수 있습니다. 

	    ClipRRect(
                borderRadius: BorderRadius.circular(20.0),
                child: Image.asset(
                  'assets/images/abc.jpeg',
                  fit: BoxFit.cover,
                ),
              )

 

'Flutter' 카테고리의 다른 글

appbar 컬러 바꾸고 싶을 때 두가지 방법  (0) 2021.12.15
debug 뱃지가 거슬릴때  (0) 2021.12.15
비율 정하기 - AspectRatio  (0) 2021.12.14
폰트 적용하기  (0) 2021.12.14
TimePicker 예제  (0) 2021.06.26