inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

[코드팩토리] [중급] Flutter 진짜 실전! 상태관리, 캐시관리, Code Generation, GoRouter, 인증로직 등 중수가 되기 위한 필수 스킬들!

type 'Null' is not a subtype of type 'List<dynamic>' in type cast

2069

Bullets

작성한 질문수 12

0

섹션 11 > Pagination 일반화하기 > RatingsPagination 렌더링하기 수강 중인데 "type 'Null' is not a subtype of type 'List<dynamic>' in type cast"라서 RatingCard가 나오지 않는데 어디서 부터 확인해야할 지 모르겠습니다... ㅠㅠ

flutter: [RES] [GET] http://127.0.0.1:3000/restaurant/5ac83bfb-f2b5-55f4-be3c-564be3f01a5b/rating/?count=20

flutter: type 'Null' is not a subtype of type 'List<dynamic>' in type cast

flutter: #0 $RatingModelFromJson (package:actual/rating/model/ratingmodel.g.dart:14:62)

#1 new RatingModel.fromJson (package:actual/rating/model/rating_model.dart:27:62)

#2 RestaurantRatingRepository.paginate.<anonymous closure> (package:actual/restaurant/repository/restaurantrating_repository.g.dart:46:29)

#3 MappedListIterable.elementAt (dart:_internal/iterable.dart:415:31)

#4 ListIterator.moveNext (dart:_internal/iterable.dart:344:26)

#5 new GrowableList.ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)

#6 new GrowableList.of (dart:core-patch/growablearray.dart:150:28)

#7 new List.of (dart:core-patch/array_patch.dart:47:28)

#8 ListIterable.toList (dart:_internal/iterable.dart:214:7)

#9 $CursorPaginationModelFromJson (package:actual/common/model/cursorpagination_model.g.dart:15:60)

#10 new CursorPaginationModel.fromJson (package:actual/common/model/cursor_pagination_model.dart:44:108)

#11 _RestaurantRatin<…>

flutter: Instance of 'CursorPaginationModelError'

flutter 하이브리드-앱

답변 1

0

코드팩토리

안녕하세요!

에러 메세지는 생각보다 심플합니다.

null을 List<dynamic>으로 예상하고 있다는 뜻인데 제 강의를 따라오시면서 null이면 안되는 상황에 null 이 들어가는 상황은 아마 파라미터 이름을 잘못 넣으셨을 가능성이 높을 것 같습니다 (스펠링 에러).

이부분을 먼저 체크해보시고 그래도 안된다면 다시 한번 답변 주세요!

감사합니다!

Isar 마지막 업데이트는 2년전입니다.

0

30

0

FlutterSecureStorage 질문

0

31

0

Dio onError Interceptor 만드는 부분에 질문이 있습니다.

0

79

2

관리자 기능에 대한 질문

0

100

2

part 'restaurant_model.g.dart';

0

92

1

36강. dio 인터셉터에 storage를 전달하는 코드가 이해 안되는데요. 도움 부탁드립니다.

0

56

2

2번 반환 상황 관련 질문

0

61

2

riverpod 3.0

0

139

2

Asset folder??

0

82

2

디자이너와 협업 시 프레임 크기 설정 관련 질문

0

113

2

FutureProvider, StateNotifierProvider 선택 기준

0

70

2

컴포넌트 모델화

0

64

2

쿼리 파라미터

0

84

2

화면 안보임

0

67

2

PaginationListView

0

54

1

강의중 37.Dio onErrorInterceptor 작업하기 dio 관련 질문입니다.

0

101

2

프로토타입이미지

0

62

2

여러 객체를 상태 관리하는 방법에 대한 질문

0

84

2

장바구니 결제하기 응답이 500이 옵니다.

0

105

2

removeFromBasket에서 await patchBasket()을 마지막에 하면 에러나는거 아닌가요?

0

67

2

이 두가지는 완전히 동일한 기능인가요?

0

106

3

내부 코드를 작성하지 않은 CursorPaginationLoading가 어떻게 로딩상태를 갖는지 잘 모르겠습니다...

0

77

2

_SplashScreenState에서 storage를 late로 호출해서 한번만 불러와도 되나요?

0

86

2

코딩 작성 순서 관련 질문

0

88

2