mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-24 13:47:24 +00:00
implement example
This commit is contained in:
16
examples/postly/lib/data/model/post_model.dart
Normal file
16
examples/postly/lib/data/model/post_model.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'post_model.freezed.dart';
|
||||
part 'post_model.g.dart';
|
||||
|
||||
@freezed
|
||||
class PostModel with _$PostModel {
|
||||
const factory PostModel({
|
||||
required int id,
|
||||
required String title,
|
||||
required String body,
|
||||
}) = _PostModel;
|
||||
|
||||
factory PostModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$PostModelFromJson(json);
|
||||
}
|
||||
Reference in New Issue
Block a user