【问题标题】:Error: The operator '[]' isn't defined for the class 'Object?'错误:没有为类“对象”定义运算符“[]”?
【发布时间】:2022-06-18 04:05:45
【问题描述】:

返回脚手架( 应用栏:应用栏( 标题:文本(“演示”), ), 身体:中心( 孩子:FutureBuilder( 未来: fetchphoto() , 构建器:(ctx,快照){

        if(snapshot.connectionState == ConnectionState.waiting){
          return CircularProgressIndicator();
        }else{
          return ListView.builder(
            itemBuilder:(_, index){
              return ListTile(
                leading: CircleAvatar(backgroundImage: NetworkImage(snapshot.data[index]['thumbnailUrl'])),
                title: Text(snapshot.data[index]['title']),
                subtitle:Text("${snapshot.data[index]??['id']}"),
              );
            },
            itemCount: 12,
          );
        }
      },
    )
  ),
   // This trailing comma makes auto-formatting nicer for build methods.
);

} }强文本

【问题讨论】:

  • 尝试将运算符更正为现有运算符,或定义“[]”运算符。前导:CircleAvatar(backgroundImage: NetworkImage(snapshot.data[index]['thumbnailUrl'])),

标签: flutter


猜你喜欢
  • 2021-08-18
  • 1970-01-01
  • 1970-01-01
  • 2021-07-31
  • 1970-01-01
  • 2020-05-31
  • 2021-10-24
  • 2021-05-11
  • 2021-10-07
相关资源
最近更新 更多