mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-29 16:26:27 +00:00
34 lines
870 B
Dart
34 lines
870 B
Dart
import 'dart:io';
|
|
|
|
import 'package:comunic/enums/post_kind.dart';
|
|
import 'package:comunic/enums/post_target.dart';
|
|
import 'package:comunic/enums/post_visibility_level.dart';
|
|
import 'package:meta/meta.dart';
|
|
|
|
/// New post information
|
|
///
|
|
/// @author Pierre HUBERT
|
|
|
|
class NewPost {
|
|
final PostTarget target;
|
|
final int targetID;
|
|
final PostVisibilityLevel visibility;
|
|
final String content;
|
|
final File image;
|
|
final PostKind kind;
|
|
|
|
NewPost({
|
|
@required this.target,
|
|
@required this.targetID,
|
|
@required this.visibility,
|
|
@required this.content,
|
|
@required this.kind,
|
|
@required this.image,
|
|
}) : assert(target != null),
|
|
assert(targetID != null),
|
|
assert(visibility != null),
|
|
assert(content != null),
|
|
assert(kind != PostKind.TEXT || content.length > 3),
|
|
assert(kind != PostKind.IMAGE || image != null);
|
|
}
|