OpenFlutter/Flutter-Notebook

BottomNavigationBar 加载最后list报错

Closed this issue · 1 comments

flutter 版本version1.0

加上body: list[_currentIndex], 后
最后报这个错误:

I/flutter ( 3081): The following RangeError was thrown building BottomNavigationWidget(dirty, state:
I/flutter ( 3081): BottomNavigationWidgetState#5a077):
I/flutter ( 3081): RangeError (index): Invalid value: Valid value range is empty: 3
I/flutter ( 3081): When the exception was thrown, this was the stack:
I/flutter ( 3081): #0 List.[] (dart:core/runtime/libgrowable_array.dart:145:60)
I/flutter ( 3081): #1 BottomNavigationWidgetState.build (package:flutter_apptwo/bottom_navigation_widget.dart:33:17)

我没有复现你的bug呢,body部分我用的就是list[_currentIndex],还有更多的信息吗