feat : Widget commentaire
This commit is contained in:
20
lib/models/animator.dart
Normal file
20
lib/models/animator.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'animator.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Animator {
|
||||
final String id;
|
||||
final String name;
|
||||
final String content;
|
||||
final String authorImageUrl = 'https://placehold.co/400x400/png';
|
||||
|
||||
Animator({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.content,
|
||||
});
|
||||
|
||||
factory Animator.fromJson(Map<String, dynamic> json) => _$AnimatorFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$AnimatorToJson(this);
|
||||
}
|
||||
19
lib/models/animator.g.dart
Normal file
19
lib/models/animator.g.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'animator.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Animator _$AnimatorFromJson(Map<String, dynamic> json) => Animator(
|
||||
id: json['id'] as String,
|
||||
name: json['name'] as String,
|
||||
content: json['content'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AnimatorToJson(Animator instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'content': instance.content,
|
||||
};
|
||||
23
lib/models/comment.dart
Normal file
23
lib/models/comment.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'comment.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Comment {
|
||||
final String id;
|
||||
final String postId;
|
||||
final String content;
|
||||
final String authorName;
|
||||
final String authorImageUrl;
|
||||
|
||||
Comment({
|
||||
required this.id,
|
||||
required this.postId,
|
||||
required this.content,
|
||||
required this.authorName,
|
||||
required this.authorImageUrl,
|
||||
});
|
||||
|
||||
factory Comment.fromJson(Map<String, dynamic> json) => _$CommentFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$CommentToJson(this);
|
||||
}
|
||||
23
lib/models/comment.g.dart
Normal file
23
lib/models/comment.g.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'comment.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Comment _$CommentFromJson(Map<String, dynamic> json) => Comment(
|
||||
id: json['id'] as String,
|
||||
postId: json['postId'] as String,
|
||||
content: json['content'] as String,
|
||||
authorName: json['authorName'] as String,
|
||||
authorImageUrl: json['authorImageUrl'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CommentToJson(Comment instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'postId': instance.postId,
|
||||
'content': instance.content,
|
||||
'authorName': instance.authorName,
|
||||
'authorImageUrl': instance.authorImageUrl,
|
||||
};
|
||||
Reference in New Issue
Block a user