CardWidget2 Flutter 플러터: 카드를 클릭 가능하게 만드는 방법은 무엇인가요?, Flutter: How do you make a card clickable? 질문 저는 new Card(child: new Text('My cool card'))와 같은 간단한 카드를 가지고 있으며, 어느 곳을 클릭하더라도 어떤 함수를 실행할 수 있도록하고 싶습니다. 그러나 Card에는 onPressed 메소드가 없습니다. 하단에 버튼을 추가할 수 있지만 이 상황에는 이상적이지 않습니다. 카드 전체를 클릭할 수 있게하는 방법을 아시는 분 계신가요? 답변 Flutter는 속성 대신 구성을 사용합니다. 원하는 위젯을 클릭 가능한 것으로 감싸서 필요한 것을 달성하세요. 일부 클릭 가능한 위젯 : GestureDetector, InkWell, InkResponse. GestureDetector( onTap: () => ......, child: Card(...), ); 2023. 6. 1. Flutter 커스텀 카드 모양 플러터 SDK, Custom Card Shape Flutter SDK 질문 I have developed an app with GridView on Flutter. GridView items are Card and the default card shape is Rectangle with a radius of 4. I know there is shape property for Card Widget and it takes ShapeBorder class but I am unable to find how to use ShapeBorder class and customize my cards in GridView. How do I go about this? 답변 이렇게 사용할 수 있습니다. Card( shape: RoundedRectangleBorder( borderRadius: .. 2023. 5. 28. 이전 1 다음