feat: added search
This commit is contained in:
parent
b54b825dad
commit
166ee5b389
7 changed files with 193 additions and 60 deletions
16
lib/domain/models/search_result.dart
Normal file
16
lib/domain/models/search_result.dart
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import 'package:seshat/domain/models/book.dart';
|
||||
import 'package:seshat/domain/models/book_instance.dart';
|
||||
|
||||
class SearchResult {
|
||||
SearchResult(this.instance, this.book);
|
||||
BookInstance instance;
|
||||
Book book;
|
||||
|
||||
factory SearchResult.fromJSON(Map<String, dynamic> json) {
|
||||
BookInstance instance = BookInstance.fromJSON(json["book_instance"]);
|
||||
|
||||
Book book = Book.fromJSON(json["book"]);
|
||||
|
||||
return SearchResult(instance, book);
|
||||
}
|
||||
}
|
||||
Reference in a new issue