Home > Net >  Error: child:Image( decoration: BoxDecoration (error in the words child and decoration)
Error: child:Image( decoration: BoxDecoration (error in the words child and decoration)

Time:01-17

 body:
    Container(
    padding: EdgeInsets.all(20.0),
      child:Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: [
          Row(
            children:const [
              Padding(
                padding:EdgeInsets.only(left: 20.0)
                child:Image( 
                  decoration:  BoxDecoration(
                    color: Colors.grey,
                    shape: BoxShape.circle,
                  ),
                  image:  AssetImage("assets/images/images.jpg"),
                ),
             ),
           ],
          ),
        ],
      ),
    ),

enter image description here

I tried a lot and watched YouTube and did not find a solution, although sometimes I write the same code written in the video

CodePudding user response:

Please try with this code.

Container(
          padding: const EdgeInsets.all(20.0),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: [
              Row(
                children: [
                  Padding(
                    padding: const EdgeInsets.only(left: 20.0),
                    child: Container(
                      decoration: const BoxDecoration(color: Colors.grey, shape: BoxShape.circle, image: DecorationImage(image: AssetImage("assets/images/images.jpg"))),
                    ),
                  ),
                ],
              ),
            ],
          ),
        ),

Your Mistakes

  • Related