Undefined name index

  android, dart, flutter

heres the code im strunggling with

@override
      Widget build(BuildContext context) {
        return Scaffold(
            body: Column(children: <Widget>[
               Stack(children: <Widget>[
                Container(
                  height: MediaQuery.of(context).size.width,
                  decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(30.0),
                  boxShadow: [
                  BoxShadow(
                    color: Colors.black26,
                    offset: Offset(0.0, 2.0),
                    blurRadius: 6.0,
                  ),
                ],
              ),
                  child: Hero(
                    tag: widget.details.image,
                    child: ClipRRect(
                      borderRadius: BorderRadius.circular(30.0),
                      child: Image(
                      image: AssetImage(
                        details[***index***].image  

It always said that the index is undefined,

and when i change it to
widget.details.image it says
no such method error
the getter ‘image’ is null
reciever null
tried calling : image

                    ),
                    fit: BoxFit.cover,
                  ),
                ),
              ),
            ),

Source: Android Questions

LEAVE A COMMENT