I don't know what's the problem here but i get an error on [this.reference], it says "The parameter 'reference' can't have a value of 'null' because of its type, but the implicit default value is 'null'." When I add required it says "Can't have modifier 'required' here"
Here's the code for it:
import 'package:cloud_firestore/cloud_firestore.dart';
class Request {
final String type;
final String reason;
DocumentReference reference;
Request(this.reason, this.type, [this.reference]);
String get requestId {
return reference.id;
}
Map<String, dynamic> toMap() {
return {"type": type, "reason": reason};
}
}