open ai service
This commit is contained in:
39
books_flutter/lib/bloc/add_book/add_book_state.dart
Normal file
39
books_flutter/lib/bloc/add_book/add_book_state.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import '../../models/models.dart';
|
||||
|
||||
class AddBookState {
|
||||
final String title;
|
||||
final String author;
|
||||
final String annotation;
|
||||
final String genre;
|
||||
final Book? editBook;
|
||||
final bool isSaved;
|
||||
|
||||
const AddBookState({
|
||||
this.title = '',
|
||||
this.author = '',
|
||||
this.annotation = '',
|
||||
this.genre = 'fiction',
|
||||
this.editBook,
|
||||
this.isSaved = false,
|
||||
});
|
||||
|
||||
bool get isEditing => editBook != null;
|
||||
|
||||
AddBookState copyWith({
|
||||
String? title,
|
||||
String? author,
|
||||
String? annotation,
|
||||
String? genre,
|
||||
Book? editBook,
|
||||
bool? isSaved,
|
||||
}) {
|
||||
return AddBookState(
|
||||
title: title ?? this.title,
|
||||
author: author ?? this.author,
|
||||
annotation: annotation ?? this.annotation,
|
||||
genre: genre ?? this.genre,
|
||||
editBook: editBook ?? this.editBook,
|
||||
isSaved: isSaved ?? this.isSaved,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user