mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-26 14:59:22 +00:00
22 lines
514 B
Dart
22 lines
514 B
Dart
import 'package:comunic/models/comment.dart';
|
|
|
|
/// Comments helper
|
|
///
|
|
/// @author Pierre HUBERT
|
|
|
|
class CommentsHelper {
|
|
/// Turn an API entry into a [Comment] object
|
|
static Comment apiToComment(Map<String, dynamic> entry) {
|
|
return Comment(
|
|
id: entry["ID"],
|
|
userID: entry["userID"],
|
|
postID: entry["postID"],
|
|
timeSent: entry["time_sent"],
|
|
content: entry["content"],
|
|
imageURL: entry["img_url"],
|
|
likes: entry["likes"],
|
|
userLike: entry["userlike"],
|
|
);
|
|
}
|
|
}
|