커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
type 'Null' is not a subtype of type 'String' 오류
[왕초보] 플러터(Flutter)로 시작하는 앱개발 종합반 v0
1주차
북마크
이*원
댓글
1
추천
0
조회수
11
조회수
11
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


안녕하세요,

1주차 숙제진행 중 마무리 단계에서 오류가 발생하여 문의드립니다.

숙제 답안을 보며 하나씩 따라서 작성 했는데요,

앱바 부분은 잘 따라한것 같은데 body 부분에서 오류가 났어요.

무엇이 원인인지 모르겠습니다.


그리고 앱바 부분 오른쪽 사람아이콘 옆에 '-' 표시가 생겼는데, 이건 뭔가요?




스파르타 즉문즉답



 return Scaffold(
appBar: AppBar(
        elevation: 0,
        backgroundColor: Colors.white,
        centerTitle: false,
        iconTheme: IconThemeData(color: Colors.black),
        title: Text(
          "Movie Reviews",
          style: TextStyle(
            color: Colors.black,
            fontSize: 28,
            fontWeight: FontWeight.bold,
          ),
        ),
        actions: [
          IconButton(
            onPressed: () {},
            icon: Icon(Icons.person_remove_outlined),
          ),
        ],
      ),

 body: Column(children: [
        Padding(
          padding: const EdgeInsets.all(8.0),
          child: TextField(
            decoration: InputDecoration(
                hintText: "영화 제목을 검색해주세요.",
                border: OutlineInputBorder(
                  borderSide: BorderSide(color: Colors.black),
                ),
                suffixIcon: IconButton(
                  icon: Icon(Icons.search),
                  onPressed: () {},
                )),
          ),
        ),
        Divider(height: 1),
        Expanded(
            child: ListView.builder(
          itemCount: dataList.length,
          itemBuilder: (context, index) {
            String category = dataList[index]['category'];
            String imgUrl = dataList[index]['imgURL'];


            return Card(
              child: Stack(
                alignment: Alignment.center,
                children: [
                  Image.network(
                    imgUrl,
                    width: double.infinity,
                    height: 200,
                    fit: BoxFit.cover,
                  ),
                  Container(
                    width: double.infinity,
                    height: 200,
                    color: Colors.black.withOpacity(0.5),
                  ),
                  Text(
                    category,
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 36,
                    ),
                  ),
                ],
              ),
            );
          },
        ))
      ]),
    );
  }
}


취소
 공유
취소
댓글 0
댓글 알림
나의얼굴