jb3rndt / PersistentBottomNavBarV2

A highly customizable persistent bottom navigation bar for Flutter
https://pub.dev/packages/persistent_bottom_nav_bar_v2
BSD 3-Clause "New" or "Revised" License
47 stars 48 forks source link

[Bug]: 'NavigationNotification' isn't a type. #143

Open shashankflutter opened 3 months ago

shashankflutter commented 3 months ago

Version

5.2.2

What platforms are you seeing the problem on?

Android

What happened?

On Run app

Code to reproduce the problem

NotificationListener<NavigationNotification>(
          onNotification: (notification) {
            final newCanPop =
                calcCanPop(subtreeCantHandlePop: !notification.canHandlePop);
            if (newCanPop != canPop) {
              setState(() {
                canPop = newCanPop;
              });
            }
            return false;
          },
          child: navigationBarWidget(),
        ),

Relevant log output

../../.pub-cache/hosted/pub.dev/persistent_bottom_nav_bar_v2-5.2.2/lib/components/persistent_tab_view.dart:361:37: Error: 'NavigationNotification' isn't a type.
        child: NotificationListener<NavigationNotification>(
                                    ^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/persistent_bottom_nav_bar_v2-5.2.2/lib/components/persistent_tab_view.dart:344:14: Error: The method 'PopScope' isn't defined for the class '_PersistentTabViewState'.
 - '_PersistentTabViewState' is from 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart' ('../../.pub-cache/hosted/pub.dev/persistent_bottom_nav_bar_v2-5.2.2/lib/persistent_bottom_nav_bar_v2.dart').
Try correcting the name to the name of an existing method, or defining a method named 'PopScope'.
      return PopScope(
             ^^^^^^^^
../../.pub-cache/hosted/pub.dev/persistent_bottom_nav_bar_v2-5.2.2/lib/components/persistent_tab_view.dart:364:64: Error: The getter 'canHandlePop' isn't defined for the class 'Object?'.
 - 'Object' is from 'dart:core'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'canHandlePop'.
                calcCanPop(subtreeCantHandlePop: !notification.canHandlePop);

Screenshots

No response

jb3rndt commented 2 months ago

Which version of flutter are you using? Please paste the output of flutter doctor -v