Inflearn Community Q&A
snapshot.data 오류
Written on
·
2.5K
1
error: The argument type 'Map<String, dynamic> Function()' can't be assigned to the parameter type 'Map<String, dynamic>'. (argument_type_not_assignable at [netflix_clone_test] lib/model/model_movie.dart:17)
snapshot.data 자체에 오류가 발생하는데 원인 파악을 못하겠습니다..ㅜㅠ
Flutterfirebase클론코딩
Answer 6
6
import 'package:cloud_firestore/cloud_firestore.dart';
class Movie {
final String title;
final String keyword;
final String poster;
final bool like;
final DocumentReference? reference;
Movie.fromMap(Map<String, dynamic> map, {this.reference})
: title = map['title'],
keyword = map['keyword'],
poster = map['poster'],
like = map['like'];
Movie.fromSnapshow(DocumentSnapshot snapshot)
: this.fromMap(snapshot.data() as Map<String, dynamic>,
reference: snapshot.reference);
@override
String toString() => 'Movice<$title:$keyword>';
}
0
0
0
0
0
snapshot.data 자체 오류 저도 걸리는데. 그게 pubspec.yaml 에서 cloud_firestore 버전 문제일겁니다. 버전 업데이트 되면서 Firestore -> FirebaseFireStore 로 바뀌고 여러가지가 바뀌었더라구요. stackoverflow 참고해서 진행하셔야할듯 합니다.






찾았네요 ~휴~