flutter_collapsible_sidebar
                                
                                
                                
                                    flutter_collapsible_sidebar copied to clipboard
                            
                            
                            
                        The method 'toDouble' was called on null.
The method 'toDouble' was called on null. Receiver: null Tried calling: toDouble()
The relevant error-causing widget was: CollapsibleSidebar file:///Users/imac/Documents/workspace/fittrack_flutter/lib/features/home/presentation/pages/home_screen.dart:48:21 When the exception was thrown, this was the stack: #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5) #1 double.* (dart:core-patch/double.dart:36:23) #2 _CollapsibleSidebarState.build (package:collapsible_sidebar/collapsible_sidebar.dart:177:46) #3 StatefulElement.build (package:flutter/src/widgets/framework.dart:4681:28) #4 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4564:15) ...
ERROR MOVE ON THIS LINE...
Stack( alignment: Alignment.topCenter, children: [ CollapsibleItemSelection( height: _maxOffsetY, ======> offsetY: _maxOffsetY * _selectedItemIndex, color: widget.selectedIconBox, duration: widget.duration, curve: widget.curve, ), Column(children: _items), ], ),
Please send entire code where the error occurs.
I had the same problem, maybe depend on the way you build CollapsibleItem list.
in my case...
List<CollapsibleItem> _buildCollapsibleItems(List<String> menuNames) {
    final List<CollapsibleItem> result = [];
    menuNames.asMap().forEach((index, value) => {
          result.add(CollapsibleItem(
              isSelected: _selectedIndex == index,
              text: value,
              icon: _iconByMenuName(value),
              onPressed: () => setState(() {
                    _headline = value;
                    _selectedIndex = index;
                  })))
        });
    return result;
}
_selectedIndex is set to zero on initState
I have the same issue. Any solution?
Can you guys send the code and the line number as shown by the terminal where the error is occurring. @dariolr @ReniDelonzek
I'll try to see where this exception is coming from.
Hello @RyuuKenshi , the error happens when no item is pre-selected. I fixed this on my fork, but I didn't submit it because I did a few more increments that may not be relevant here. But set _selectedItemIndex = 0; in initState should resolve
Hi @JatinJD14296, @dariolr, @ReniDelonzek, I have implemented some changes to this package. Please check once if this problem has been resolved, and if yes then close this issue.