skip to Main Content

Expected :

enter image description here

What I get :

enter image description here

i want to move the Positioned widget outside the stack ,

(in CSS we use Z-index, how to do it in flutter ? )

code :

 Column( Expanded(
              child: Stack(
                children: [
                  Container(
                   .........
                  ),
                  Positioned(
                    top: -30, <-- here
                    right: 60,
                    child: CircleAvatar(
                      backgroundColor: Colors.red,
                      radius: 30,
                      child: Icon(
                        Icons.favorite,
                        color: Colors.black,
                      ),
                    ),
                 ),

  ...........

2

Answers


  1. Chosen as BEST ANSWER

    Problem solved with clipBehavior: Clip.none,

    Stack(
       clipBehavior: Clip.none,
    ...
    )
    

  2.     Please add  clipBehavior: Clip.none,
    
    
     Stack(
            clipBehavior: Clip.none,
                    children: [
                      Container(
                       .........
                      ),
                      Positioned(
                        top: -30, <-- here
                        right: 60,
                        child: CircleAvatar(
                          backgroundColor: Colors.red,
                          radius: 30,
                          child: Icon(
                            Icons.favorite,
                            color: Colors.black,
                          ),
                        ),
                     )
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search