Skip to content

NoSuchMethodError: The getter 'value' was called on null. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mehrdad-shokri opened this issue Jun 12, 2020 · 10 comments · Fixed by #3
Closed

NoSuchMethodError: The getter 'value' was called on null. #1

mehrdad-shokri opened this issue Jun 12, 2020 · 10 comments · Fixed by #3

Comments

@mehrdad-shokri
Copy link

mehrdad-shokri commented Jun 12, 2020

════════ Exception caught by widgets library ════════════════
The following NoSuchMethodError was thrown building AnimatedBottomNavigationBar(dirty, dependencies: [_ScaffoldScope, _EffectiveTickerMode], state: _AnimatedBottomNavigationBarState#a9a1c):
The getter 'value' was called on null.
Receiver: null
Tried calling: value

pubsepc.yaml
animated_bottom_navigation_bar: 0.1.2+2

home.dart:

Scaffload(
   ...
    bottomNavigationBar: AnimatedBottomNavigationBar(
        icons: [Icons.brightness_5, Icons.brightness_4],
        activeIndex: _bottomNavigationIndex,
        gapLocation: GapLocation.center,
        notchSmoothness: NotchSmoothness.verySmoothEdge,
        leftCornerRadius: 32,
        rightCornerRadius: 32,
        onTap: (index) => setState(() => _bottomNavigationIndex = index),
        //other params
      )
);

It's this line:
width: widget.gapWidth * widget.notchAndCornersAnimation.value, line 212 animated_bottom_navigation_bar.dart

@nkenna
Copy link

nkenna commented Jun 30, 2020

ANy solution to this?

@mehrdad-shokri
Copy link
Author

@nkenna refer to the example you need to provide notchAndCornersAnimation argument to the AnimatedBottomNavigationBar

@TimilehinEmmanuelOJO
Copy link

@nkenna refer to the example you need to provide notchAndCornersAnimation argument to the AnimatedBottomNavigationBar

i have done this but still experiencing the same error

@doppio
Copy link

doppio commented Aug 26, 2020

The README doesn't mention this parameter and the internal documentation describes it as optional. Does the documentation need to be updated or should it actually be optional?

@mehrdad-shokri
Copy link
Author

@doppio previously I read the source code it calls this member value and does not initialize anywhere by itself so I guess README should be updated

@LuizFmdr
Copy link
Contributor

LuizFmdr commented Sep 6, 2020

Esse problema esta corrigido no meu fork.
Add to pubspec.yaml:
animated_bottom_navigation_bar:
git:
url: https://github.com/LuizFilipeMedeira/animated-bottom-navigation-bar-flutter
ref: master

@dxganta
Copy link

dxganta commented Sep 22, 2020

Add this bit of code in your initState and the error will go away:

final systemTheme = SystemUiOverlayStyle.light.copyWith(
systemNavigationBarColor: Colors.black,
systemNavigationBarIconBrightness: Brightness.light,
);
SystemChrome.setSystemUIOverlayStyle(systemTheme);

@yash-dxt
Copy link

I'm getting the same issue but on line 236.
This happens when I put:
gapLocation: GapLocation.end
Also, I'm using a floating action button here.

@is10vmust
Copy link

Same here , any one have a solution

@is10vmust
Copy link

Esse problema esta corrigido no meu fork.
Add to pubspec.yaml:
animated_bottom_navigation_bar:
git:
url: https://github.com/LuizFilipeMedeira/animated-bottom-navigation-bar-flutter
ref: master

Thats worked with me @LuizFilipeMedeira Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants