작성
·
357
·
수정됨
0
DataUtils
static List<String> ListPathsToUrls(List paths){
return paths.map((e) => pathToUrl(e)).toList();
}
수정 후 아래와 같은 에러가 나서요..(Rating contents가 나오질 않습니다.)
==>
flutter pub run build_runner build로 해도 에러코드가 발생하는데.. 확인 부탁드립니다.
다음 강의 수강을 위해서 앱실행이 안되고 수업을 따라갈수가 없어서요.. 다시 한번 부탁드립니다.
lib/common/data_utils.dart:10:43: Error: A value of type 'List<dynamic>' can't be returned from a function with return type 'List<String>'.
- 'List' is from 'dart:core'.
return paths.map((e) => pathToUrl(e)).toList();
==> flutter clean
==> flutter pub get
==> flutter pub run build_runner build
===========> pub finished with exit code 78
flutter: type 'List<dynamic>' is not a subtype of type 'List<String>'
flutter: #0 $RatingModelFromJson (package:actual/rating/model/ratingmodel.g.dart:14:22)
#1 new RatingModel.fromJson (package:actual/rating/model/rating_model.dart:28:6)
#2 RestaurantRatingRepository.paginate.<anonymous closure> (package:actual/restaurant/repository/restaurantrating_repository.g.dart:46:29)
#3 MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
#4 ListIterator.moveNext (dart:_internal/iterable.dart:342: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:51:28)
#8 ListIterable.toList (dart:_internal/iterable.dart:213:44)
#9 $CursorPaginationFromJson (package:actual/common/model/cursorpagination.g.dart:15:60)
#10 new CursorPagination.fromJson (package:actual/common/model/cursor_pagination.dart:41:7)
#11 _RestaurantRatingRepository.paginate (pa<…>
안녕하세요.
어딘가에서 타입 지정을 잘못해서 에러가 나시는 것 같습니다.
레포지토리 공유해주시면 확인해볼게요!