westdabestdb/bubble_bottom_bar

The method 'withOpacity' was called on null

Closed this issue · 2 comments

Hello,

I get this error message when trying to use this repository:
NoSuchMethodError: THe method 'withOpcaity' was called on null. Receiver: null tried calling: withOpacity(0.2)

I am using similar code as in your example:

bottomNavigationBar: BubbleBottomBar( opacity: 0.2, borderRadius: BorderRadius.vertical(top: Radius.circular(16)), elevation: 8, currentIndex: _selectedPage, onTap: (int index) { setState(() { _selectedPage = index; }); }, items: <BubbleBottomBarItem>[ BubbleBottomBarItem( icon: Icon(FontAwesomeIcons.question, color: Colors.black87,), title: Text('Explore', style: TextStyle(color: Colors.black87),), ), BubbleBottomBarItem( icon: Icon(FontAwesomeIcons.random, color: Colors.black87), title: Text('Lovers', style: TextStyle(color: Colors.black87),), ), BubbleBottomBarItem( icon: Icon(FontAwesomeIcons.heart, color: Colors.black87), title: Text('Matches', style: TextStyle(color: Colors.black87),) ), BubbleBottomBarItem( icon: Icon(Icons.person, color: Colors.black87), title: Text('Profile', style: TextStyle(color: Colors.black87),), ), ] ),

Thanks in advance

https://pastebin.com/ZieQFj3p

Here is a pastebin, the formatting looks weird on here.

Hello, you forgot to add backgroundColor attribute to BubbleBottomBarItem.