skip to Main Content

I want to put the Image on the edge of the container in flutter

As in shown in image

img

2

Answers


  1. Use a stack widget where the children of the stack would be the container and the image wrapped in a positioned widget.

    Login or Signup to reply.
  2. demo

    Stack(
              clipBehavior: Clip.none,
              children: [
                Container(
                  height: 200,
                  decoration: BoxDecoration(
                    color: Colors.grey.shade400,
                    borderRadius: BorderRadius.circular(30),
                  ),
                ),
                Positioned(
                  top: 135,
                  child: Padding(
                    padding: const EdgeInsets.symmetric(horizontal: 8.0),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Image.network(
                          "https://pngimg.com/uploads/mercedes/mercedes_PNG80135.png",
                          height: 125,
                        ),
    
                        const SizedBox(width: 30,),
    
                        FloatingActionButton(
                          onPressed: (){},
                          backgroundColor: Colors.white,
                          child: const Icon(Icons.arrow_forward,color: Colors.black,),
                        ),
                      ],
                    ),
                  ),
                )
              ],
            ),
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search