23 lines
542 B
Dart
23 lines
542 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'informationModel.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class InformationModel {
|
|
final String title;
|
|
final String content;
|
|
final String author;
|
|
final DateTime createdAt;
|
|
|
|
InformationModel({
|
|
required this.title,
|
|
required this.content,
|
|
required this.author,
|
|
required this.createdAt,
|
|
});
|
|
|
|
factory InformationModel.fromJson(Map<String, dynamic> json) =>
|
|
_$InformationModelFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$InformationModelToJson(this);
|
|
} |