-
[ Flutter ] InkWell 제거Application/Flutter 2024. 7. 10. 01:43반응형
ExpansionTile을 이용하다보니
divider가 색이있고,
또한 부모로 Container를 두었을때 border가 있다면
클릭하면 물결 효과가 사각형으로 나와서 이상하게 나온다.
처음에는 ExpansionTile에 Padding을 강제로 주어서 Container안에 넣어 안보이게 처리했지만
ThemeData에 splashColor와 highlightColor의 색상만 변경해주면 되는 것 찾게 되었다.
splashColor : 터치가 발생한 곳에서 시작하여 퍼지는 효과
highlightColor : 위젯 전체로 물결 효과
반응형기존에 이렇게 썻던것을 ThemeData로 묶어서 사용
data: Theme.of(context).copyWith(dividerColor: Colors.transparent),
CustomContainer( child: Theme( data: ThemeData( dividerColor: Colors.transparent, splashColor: Colors.transparent, highlightColor: Colors.transparent, ), child: Padding( padding: const EdgeInsets.fromLTRB(0.0, 4.0, 0.0, 4.0), child: ExpansionTile( backgroundColor: Colors.transparent, title: Text('Item 1',style: TextStyle(color: textColor)), iconColor: textColor, onExpansionChanged: (bool expanded) { setState(() { _isExpanded = expanded; }); }, ....
728x90반응형'Application > Flutter' 카테고리의 다른 글
[ Flutter ] TextField 사용 및 Style (0) 2024.07.20 [ Flutter ] showModalBottomSheet 화면 하단 팝업 (0) 2024.07.11 [ Flutter ] ExpansionTile 확장 리스트 (0) 2024.07.10 [ Flutter ] 캐시 저장 SharedPreferences (0) 2024.07.07 [ Flutter ] 다크모드 설정 구현하기 (0) 2024.07.07