mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-24 21:57:58 +00:00
implement example
This commit is contained in:
12
examples/postly/lib/domain/entity/post.dart
Normal file
12
examples/postly/lib/domain/entity/post.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'post.freezed.dart';
|
||||
|
||||
@freezed
|
||||
class Post with _$Post {
|
||||
const factory Post({
|
||||
required int id,
|
||||
required String title,
|
||||
required String body,
|
||||
}) = _Post;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import 'package:dartz/dartz.dart';
|
||||
import '../entity/post.dart';
|
||||
|
||||
abstract class PostRepository {
|
||||
Future<Either<Exception, List<Post>>> getPosts();
|
||||
Future<Either<Exception, Post>> getPost(int id);
|
||||
}
|
||||
Reference in New Issue
Block a user