본문 바로가기
개발자의 공부방/모바일

Flutter] Checkbox를 동그라미로 커스텀해보자.

by 쥬니준 2022. 3. 15.
728x90
반응형

체크박스를 사용하는 경우가 상당히 많은데, 커스텀해서 사용하는 방법을 알아보자.

 

Checkbox(
    value: true,
    onChanged: (bool? value) {
      print('체크박스');
    },
    shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(10)),
    checkColor: Colors.white,
    // fillColor: MaterialStateProperty.resolveWith(getColor),
    activeColor: Color(0xff06bbfb),
    materialTapTargetSize: MaterialTapTargetSize.padded,
),

Checkbox에 shape을 이용하면 사각형 형태가 아래와 같이 구 형태로 바뀌게 된다.

 

 

 

 

 

참고 : https://stackoverflow.com/questions/52326268/how-to-create-a-round-checkbox-in-flutter-or-change-the-checkboxs-style-suc

 

How to create a round CheckBox in Flutter ? Or change the CheckBox's style , such as selected image in Flutter?

I want to create a round CheckBox like this I've tried multiple variations of this, but none of them seem to work. Including I tried to use ClipRRect . Because there are more code, I only selec...

stackoverflow.com

 

반응형

댓글0