How can I construct a flutter class for firestore snapshot for flutter 2.0
I tried something like this:
import 'package:cloud_firestore/cloud_firestore.dart';
class Post {
final String pid;
final String description;
final DocumentReference reference;
Post.fromMap(Map<String, dynamic> map, this.pid, this.description, {required this.reference})
Post.fromSnapshot(DocumentSnapshot snapshot)
: this.fromMap(snapshot.data(), reference: snapshot.reference);
@override
String toString() => "Post<$pid:$description>";
}
But there is an error saying 3 positional arguments expected but 1 found.