2017-12-07 07:08:32 +00:00
|
|
|
library angel_serialize.test.models.author;
|
|
|
|
|
|
|
|
import 'package:angel_framework/common.dart';
|
|
|
|
import 'package:angel_serialize/angel_serialize.dart';
|
|
|
|
import 'book.dart';
|
2018-03-29 19:58:36 +00:00
|
|
|
|
2017-12-07 07:08:32 +00:00
|
|
|
part 'author.g.dart';
|
2018-03-29 19:58:36 +00:00
|
|
|
|
2018-02-28 01:10:57 +00:00
|
|
|
part 'author.serializer.g.dart';
|
2017-12-07 07:08:32 +00:00
|
|
|
|
|
|
|
@serializable
|
|
|
|
abstract class _Author extends Model {
|
2018-05-13 16:50:59 +00:00
|
|
|
String get name;
|
|
|
|
int get age;
|
|
|
|
List<Book> get books;
|
|
|
|
Book get newestBook;
|
2018-03-02 18:38:41 +00:00
|
|
|
|
2017-12-07 07:08:32 +00:00
|
|
|
@exclude
|
2018-05-13 16:50:59 +00:00
|
|
|
String get secret;
|
2018-03-02 18:38:41 +00:00
|
|
|
|
|
|
|
@Exclude(canDeserialize: true)
|
2018-05-13 16:50:59 +00:00
|
|
|
String get obscured;
|
2017-12-07 07:08:32 +00:00
|
|
|
}
|
|
|
|
|
2018-03-29 19:58:36 +00:00
|
|
|
@Serializable(serializers: Serializers.all)
|
2017-12-07 07:08:32 +00:00
|
|
|
abstract class _Library extends Model {
|
2018-05-13 16:50:59 +00:00
|
|
|
Map<String, Book> get collection;
|
2018-02-28 00:36:53 +00:00
|
|
|
}
|
2018-05-13 17:23:40 +00:00
|
|
|
|
|
|
|
@serializable
|
|
|
|
abstract class _Bookmark extends Model {
|
|
|
|
@exclude
|
|
|
|
final Book book;
|
|
|
|
|
|
|
|
int get page;
|
|
|
|
String get comment;
|
|
|
|
|
|
|
|
_Bookmark(this.book);
|
|
|
|
}
|