anchor.diff:      return AppRoutePath();
     }
   
  -  void _handleTabSelected(int idx) {
  -    if (idx == 0) {
  -      _appState.page = AppPage.newBooks;
  -    } else {
  -      _appState.page = AppPage.allBooks;
  -    }
  -  }
  -
  -  @override
  -  Widget build(BuildContext context) {
  -    late final Widget innerScreen;
  -    if (_appState.page == AppPage.settings) {
  -      innerScreen = SettingsScreen();
  -    } else {
  -      innerScreen = BooksScreen(
  -        appPage: _appState.page,
  -        onTabSelected: _handleTabSelected,
  -      );
  -    }
  -
  -    final bottomBarIndex =
  -    _appState.page == AppPage.allBooks || _appState.page == AppPage.newBooks
  -        ? 0
  -        : 1;
  -    return Navigator(
  -      key: navigatorKey,
  -      pages: [
  -        MaterialPage(
  -          key: ValueKey('BooksScreen'),
  -          child: AppScaffold(
  -            currentIndex: bottomBarIndex,
  -            onIndexChanged: (idx) {
  -              if (idx == 0) {
  -                _appState.page = AppPage.newBooks;
  -              } else {
  -                _appState.page = AppPage.settings;
  -              }
  -            },
  -            child: innerScreen,
  -          ),
  -        ),
  -      ],
  -      onPopPage: (route, result) {
  -        return route.didPop(result);
  -      },
  -    );
  -  }
  -}
  -
  -class AppRoutePath {}
  -
  -class NewBooksRoutePath extends AppRoutePath {}
  -
  -class AllBooksRoutePath extends AppRoutePath {}
  -
  -class SettingsRoutePath extends AppRoutePath {}
  -
  -class AppScaffold extends StatelessWidget {
  -  final int currentIndex;
  -  final ValueChanged<int> onIndexChanged;
  -  final Widget child;
  -
  -  AppScaffold({
  -    required this.currentIndex,
  -    required this.onIndexChanged,
  -    required this.child,
  -  });
  -
  -  @override
  -  Widget build(BuildContext context) {
  +  @override
  +  Widget build(BuildContext context) {
  +    return Overlay(
  +      initialEntries: [_overlayEntry],
  +    );
  +  }
  +
  +  Widget _overlayEntryBuilder(BuildContext context) {
       return Scaffold(
  -      appBar: AppBar(),
  -      body: Center(
  -        child: child,
  +      body: Navigator(
  +        key: navigatorKey,
  +        pages: [
  +          if (_appState.page == AppPage.settings)
  +            FadeTransitionPage(
  +              key: ValueKey('SettingsScreen'),
  +              child: SettingsScreen(),
  +            ),
  +          if (_appState.page == AppPage.newBooks ||
  +              _appState.page == AppPage.allBooks)
  +            FadeTransitionPage(
  +              key: ValueKey('BooksScreen'),
  +              child: BooksScreen(
  +                onTabSelected: (int idx) {
  +                  if (idx == 0) {
  +                    _appState.page = AppPage.newBooks;
  +                  } else {
  +                    _appState.page = AppPage.allBooks;
  +                  }
  +                },
  +                appPage: _appState.page,
  +              ),
  +            ),
  +        ],
  +        onPopPage: (route, result) {
  +          return route.didPop(result);
  +        },
         ),
         bottomNavigationBar: BottomNavigationBar(
  -        currentIndex: currentIndex,
  -        onTap: onIndexChanged,
  +        currentIndex: _appState.page == AppPage.settings ? 1 : 0,
  +        onTap: (idx) {
  +          if (idx == 0) {
  +            _appState.page = AppPage.newBooks;
  +          } else {
  +            _appState.page = AppPage.settings;
  +          }
  +        },
           items: [
             BottomNavigationBarItem(
               label: 'Books',
  
positive.code: class SettingsScreen extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Center(
        child: Text('Settings'),
      );
    }
  }
  
negative.code: class NewBooksScreen extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Center(
          child: Text('New Books'),
        ),
      );
    }
  }
  
  class FadeTransitionPage extends Page {
    final Widget child;
  
    FadeTransitionPage({LocalKey? key, required this.child}) : super(key: key);
  
    @override
    Route createRoute(BuildContext context) {
      return PageRouteBuilder(
        settings: this,
        pageBuilder: (context, animation, animation2) {
          var curveTween = CurveTween(curve: Curves.easeIn);
          return FadeTransition(
            opacity: animation.drive(curveTween),
            child: child,
          );
        },
      );
    }
  }
  