
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
당근마켓 화면 코딩 중
하트를 클릭하면 색깔이 변하는 과정을 했는데
저의경우 클릭도 되지않고 색깔도 변하지 않아
무었이 문제인지 문의드립니다...
그리고 추후 코딩 연습을 할때 원하는대로 작동이 되지 않을경우 코딩에 문제가있는지 여부를 어떻게 확인해야 하나요,....?

작성한 코드 및 에러 메세지
feed.dart 입니다.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class feed extends StatefulWidget {
const feed({
Key? key,
}) : super(key: key);
@override
State<feed> createState() => _feedState();
}
class _feedState extends State<feed> {
// 좋아요 여부
bool isFavorite = false;
@override
Widget build(BuildContext context) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// CilpRRect 를 통해 이미지에 곡선 border 생성
ClipRRect(
borderRadius: BorderRadius.circular(8),
// 이미지
child: Image.network(
'https://cdn2.thecatapi.com/images/6bt.jpg',
width: 100,
height: 100,
fit: BoxFit.cover,
),
),
SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'M1 아이패드 프로 11형(3세대) 와이파이 128G 팝니다.',
style: TextStyle(
fontSize: 16,
color: Colors.black,
),
softWrap: false,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
SizedBox(height: 2),
Text(
'봉천동 · 6분 전',
style: TextStyle(
fontSize: 12,
color: Colors.black45,
),
),
SizedBox(height: 4),
Text(
'100만원',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
Row(
children: [
Spacer(),
GestureDetector(
onTap: () {
// 화면 갱신
setState(() {
isFavorite = !isFavorite; // 좋아요 토글
});
},
child: Row(
children: [
Icon(
isFavorite
? CupertinoIcons.heart_fill
: CupertinoIcons.heart,
color: isFavorite ? Colors.pink : Colors.black,
size: 16,
),
Text(
'1',
style: TextStyle(color: Colors.black54),
),
],
),
)
],
),
],
),
),
],
);
}
}
