isComplete method Null safety
Checks if all neccessary fields of the Statement are filled in.
Implementation
bool isComplete() {
//check statement
if (statementText.isEmpty ||
statementAuthor.isEmpty ||
statementCategory.isEmpty ||
statementCorrectness.isEmpty ||
statementLanguage.isEmpty ||
statementLink.isEmpty ||
statementMedia.isEmpty ||
statementMediatype.isEmpty ||
(statementPictureURL == null && (uploadImage == null))) {
return false;
}
//check all facts
for (var fact in statementFactchecks.facts) {
if (fact.factAuthor.isEmpty ||
fact.factLanguage.isEmpty ||
fact.factLink.isEmpty ||
fact.factMedia.isEmpty ||
fact.factText.isEmpty) {
return false;
}
}
return true;
}