Flutter
[Flutter] 버튼 프레스 효과 / 물결
junetudy
2023. 9. 18. 15:00

버튼(또는 박스)를 누르면 프레스 효과를 줄것이다.
1. InkWell위젯을 사용할 것.
2. onTap 핸들러를 설정하여, 기능은 그대로 유지할 것.
Positioned(
left: 38,
top: 231,
child: InkWell(
onTap: () {},
borderRadius: BorderRadius.circular(10),
splashColor: Colors.white.withOpacity(0.5),
highlightColor: Colors.white.withOpacity(0.1),
)
)
# 위 코드가 에러가 난다?
Material위젯을 추가하여, InkWell 위젯을 자식위젯으로 넣어준다.
Positioned(
left: 38,
top: 231,
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () {},
borderRadius: BorderRadius.circular(10),
splashColor: Colors.white.withOpacity(0.5),
highlightColor: Colors.white.withOpacity(0.1),
child: Container(...
)
)
)
)
끝*