anchor.diff:    Future<void> setNewRoutePath(BookRoutePath path) async {
       if (path.isDetailsPage) {
         final id = path.id;
  -      _appState.setSelected(id);
  +      _appState.selectedBookId = id;
       } else {
         _appState.clearSelectedBook();
       }
     }
   
  -  void _handleBookTapped(Book book) {
  -    _appState.selectedBook = book;
  +  void _handleBookTapped(int bookId) {
  +    _appState.selectedBookId = bookId;
     }
   }
   
  
positive.code: 
  class BooksListScreen extends StatelessWidget {
    final List<Book> books;
    final ValueChanged<Book> onTapped;
  
    BooksListScreen({
      required this.books,
  
negative.code: }
  
  class AppState extends ChangeNotifier {
    int? _selectedBookId;
  
    int? get selectedBookId => _selectedBookId;
  
    set selectedBookId(int? id) {
      _selectedBookId = id;
      notifyListeners();
    }
  
    Book? get selectedBook {
      var idx = _selectedBookId;
      if (idx == null) {
        return null;
      }
      return books[idx];
    }
  
    set selectedBook(Book? book) {
      if (book == null) {
        _selectedBookId = null;
        notifyListeners();
        return;
      }
  
      var id = books.indexOf(book);
      if (id == -1) {
        _selectedBookId = null;
      } else {
        _selectedBookId = id;
      }
  
      notifyListeners();
    }
  
    void clearSelectedBook() {
      _selectedBookId = null;
      notifyListeners();
    }
  }
  
  