-
카테고리
-
세부 분야
모바일 앱 개발
-
해결 여부
미해결
({this.movies}); 에서 movies가 에러나는 이유를 모르겠습니다 ㅠㅠ
21.06.14 04:43 작성 조회수 583
1
이게 에러나서 그런지
movies;
images;
likes;
_currentKeyword; 얘네도 다 에러나네요.. 아시는분 댓글좀요 !!
답변을 작성해보세요.
3
![장주명님의 프로필](https://cdn.inflearn.com/public/main/profile/default_profile.png?w=48)
장주명
2021.06.27
아마도 이런 에러가 나타날 겁니다.
Try adding an initializer expression, or a generative constructor that initializes it, or mark it 'late'.dart(not_initialized_non_nullable_instance_field)
이는 이번에 플러터가 nullable 정책을 바꿔서 일어난 것으로
이렇게 변경하면 됩니다.
1
![halfwing1998님의 프로필](https://cdn.inflearn.com/public/main/profile/default_profile.png?w=48)
halfwing1998
2021.12.22
initState 부분까지 입니다. 플러터가 null 값을 신경 많이 쓰네요 참고 바랍니다
0
0
![신종원님의 프로필](https://cdn.inflearn.com/public/main/profile/default_profile.png?w=48)
신종원
2022.03.07
이렇게 사용하시면 됩니다.
0
0
yongsoocho
2021.08.21
final List<Movie> movies; 이부분을
final dynamic movies 로 바꾸면 오류없이 잘됩니다^^
{this.movies} nullable 로 바뀌어요
나머지는 late 붙이면 됩니다
0
![전가현님의 프로필](https://cdn.inflearn.com/public/main/profile/default_profile.png?w=48)
전가현
2021.07.12
저도 잘 모르지만 null safety 때문이지 않나요? 저는
List<Movie>? movies;
List<Widget>? images;
이런식으로 값이 아직 안들어와있는 상태에서는 ? 이걸로 해주시거나
앞에 late 를 붙여주시면 될거같슴다.
this.movie또한
final List<Movie>? movies; 로 해주면 @requ를 하지않아도 에러는 사라집니다.
0
0
0
답변 10