1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-09-18 21:38:48 +00:00

Can create surveys

This commit is contained in:
2020-04-25 11:58:45 +02:00
parent 8af4a61072
commit 4e951c6a78
4 changed files with 193 additions and 10 deletions

View File

@@ -9,6 +9,17 @@ import 'package:meta/meta.dart';
///
/// @author Pierre HUBERT
class NewSurvey {
final String question;
final Set<String> answers;
const NewSurvey({
@required this.question,
@required this.answers,
}) : assert(question != null),
assert(answers.length > 1);
}
class NewPost {
final PostTarget target;
final int targetID;
@@ -18,6 +29,7 @@ class NewPost {
final List<int> pdf;
final PostKind kind;
final DateTime timeEnd;
final NewSurvey survey;
const NewPost({
@required this.target,
@@ -28,6 +40,7 @@ class NewPost {
@required this.image,
@required this.pdf,
@required this.timeEnd,
@required this.survey,
}) : assert(target != null),
assert(targetID != null),
assert(visibility != null),
@@ -35,5 +48,6 @@ class NewPost {
assert(kind != PostKind.TEXT || content.length > 3),
assert(kind != PostKind.IMAGE || image != null),
assert(kind != PostKind.PDF || pdf != null),
assert(kind != PostKind.COUNTDOWN || timeEnd != null);
assert(kind != PostKind.COUNTDOWN || timeEnd != null),
assert(kind != PostKind.SURVEY || survey != null);
}