我收到此错误: - 此表达式的类型为“void”,因此无法使用其值。尝试检查您是否使用了正确的 API;可能有一个函数或调用返回您没想到的 void。还要检查也可能为空的类型参数和变量。
在此代码的第 134 行:-
class toDoList extends StatefulWidget
{
bool data = false;
@override
createState()
{
return new toDoListState();
}
}
class toDoListState extends State<toDoList>
{
List<String> tasks = [];
List<String> completedTasks = [];
List<String> descriptions = [];
List<bool> importance = [];
@override
Widget build(BuildContext context)
{
return Scaffold
(
body: buildToDoList(),
floatingActionButton: new FloatingActionButton
(
onPressed: addToDoItemScreen,
tooltip: 'Add Task',
child: new Icon(Icons.add),
),
);
}
Widget buildToDoList()
{
return new ListView.builder
(
itemBuilder: (context, …Run Code Online (Sandbox Code Playgroud)