1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 08:15:16 +00:00

Do not render survey pie chart which have not response

This commit is contained in:
2020-04-25 17:28:13 +02:00
parent cbc0de944e
commit e1f8ad1466
2 changed files with 20 additions and 6 deletions

View File

@ -33,6 +33,9 @@ class Survey {
bool get hasResponded => this.userChoice != null && this.userChoice > 0;
bool get hasResponses =>
this.choices.where((f) => f.responses > 0).length > 0;
SurveyChoice get userResponse {
if (!hasResponded) return null;