mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-09-18 21:38:48 +00:00
Can create surveys
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user