Search code examples
flutterflutter-layoutflutter-animationflutter-design

How I can set this icon to top right corner without space in flutter UI


I am new for flutter I want this edit icon to top right corner without any space (margin) like this Screenshot what I want

Edit icon touch to top right corner without and space and edit icon is over the ID row

but when i code edit icon have some default space from top and right corner and ID row start at bottom of edit icon like below SS

SS of what i developed

My Code is

 Container(
              width: double.infinity,
              height: 330,
              margin: EdgeInsets.fromLTRB(40, 30, 40, 0),
              decoration: BoxDecoration(
                  border: Border.all(color: Colors.white, width: 5),
                  borderRadius: BorderRadius.all(Radius.circular(10)),
                  color: Colors.white),
              child: Column(
                children: [
                  Row(
                    children: [
                      Container(
                        child: Icon(
                          Icons.edit,
                          color: Colors.blue,
                        ),
                        color: Colors.pinkAccent,
                        width: 35,
                        height: 35,
                      ),
                    ],
                    mainAxisAlignment: MainAxisAlignment.end,
                  ),
                  Row(
                    children: [
                      Container(
                        width: 40,
                        height: 40,
                        margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
                        decoration: BoxDecoration(
                          color: Color(0xfffce8ef),
                          border:
                              Border.all(color: Color(0xfffce8ef), width: 1),
                          borderRadius: BorderRadius.all(Radius.circular(10)),
                        ),
                        child: Center(
                          child: Icon(
                            Icons.tag,
                            color: Color(0xfff2426d),
                          ),
                        ),
                      ),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Container(
                            margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
                            child: Text("ID :",
                                style: TextStyle(
                                    fontWeight: FontWeight.bold, fontSize: 15)),
                          ),
                          Container(
                            margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
                            child: Text("#12345",
                                style: TextStyle(
                                    fontWeight: FontWeight.normal,
                                    fontSize: 15)),
                          ),
                        ],
                      ),
                    ],
                  ),
                  Row(
                    children: [
                      Container(
                        width: 40,
                        height: 40,
                        margin: EdgeInsets.fromLTRB(20, 20, 0, 0),
                        decoration: BoxDecoration(
                          color: Color(0xfffce8ef),
                          border:
                              Border.all(color: Color(0xfffce8ef), width: 1),
                          borderRadius: BorderRadius.all(Radius.circular(10)),
                        ),
                        child: Center(
                          child: Icon(
                            Icons.phone_android_outlined,
                            color: Color(0xfff2426d),
                          ),
                        ),
                      ),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Container(
                            margin: EdgeInsets.fromLTRB(20, 20, 0, 0),
                            child: Text("Phone Number :",
                                style: TextStyle(
                                    fontWeight: FontWeight.bold, fontSize: 15)),
                          ),
                          Container(
                            margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
                            child: Text("+83 1234567890",
                                style: TextStyle(
                                    fontWeight: FontWeight.normal,
                                    fontSize: 15)),
                          ),
                        ],
                      ),
                    ],
                  ),
                  Row(
                    children: [
                      Container(
                        width: 40,
                        height: 40,
                        margin: EdgeInsets.fromLTRB(20, 20, 0, 0),
                        decoration: BoxDecoration(
                          color: Color(0xfffce8ef),
                          border:
                              Border.all(color: Color(0xfffce8ef), width: 1),
                          borderRadius: BorderRadius.all(Radius.circular(10)),
                        ),
                        child: Center(
                          child: Icon(
                            Icons.mail_outline_rounded,
                            color: Color(0xfff2426d),
                          ),
                        ),
                      ),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Container(
                            margin: EdgeInsets.fromLTRB(20, 20, 0, 0),
                            child: Text("Email Id :",
                                style: TextStyle(
                                    fontWeight: FontWeight.bold, fontSize: 15)),
                          ),
                          Container(
                            margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
                            child: Text("[email protected]",
                                style: TextStyle(
                                    fontWeight: FontWeight.normal,
                                    fontSize: 15)),
                          ),
                        ],
                      ),
                    ],
                  ),
                  Row(
                    children: [
                      Container(
                        width: 40,
                        height: 40,
                        margin: EdgeInsets.fromLTRB(20, 20, 0, 0),
                        decoration: BoxDecoration(
                          color: Color(0xfffce8ef),
                          border:
                              Border.all(color: Color(0xfffce8ef), width: 1),
                          borderRadius: BorderRadius.all(Radius.circular(10)),
                        ),
                        child: Center(
                          child: Icon(
                            Icons.outlined_flag,
                            color: Color(0xfff2426d),
                          ),
                        ),
                      ),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Container(
                            margin: EdgeInsets.fromLTRB(20, 20, 0, 0),
                            child: Text("Language :",
                                style: TextStyle(
                                    fontWeight: FontWeight.bold, fontSize: 15)),
                          ),
                          Container(
                            margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
                            child: Text("English",
                                style: TextStyle(
                                    fontWeight: FontWeight.normal,
                                    fontSize: 15)),
                          ),
                        ],
                      ),
                    ],
                  ),
                  Row(
                    children: [
                      Container(
                        width: 40,
                        height: 40,
                        margin: EdgeInsets.fromLTRB(20, 20, 0, 0),
                        decoration: BoxDecoration(
                          color: Color(0xfffce8ef),
                          border:
                              Border.all(color: Color(0xfffce8ef), width: 1),
                          borderRadius: BorderRadius.all(Radius.circular(10)),
                        ),
                        child: Center(
                          child: Icon(
                            Icons.person_outline_rounded,
                            color: Color(0xfff2426d),
                          ),
                        ),
                      ),
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Container(
                            margin: EdgeInsets.fromLTRB(20, 20, 0, 0),
                            child: Text("Member Since :",
                                style: TextStyle(
                                    fontWeight: FontWeight.bold, fontSize: 15)),
                          ),
                          Container(
                            margin: EdgeInsets.fromLTRB(20, 0, 0, 0),
                            child: Text("June 2013",
                                style: TextStyle(
                                    fontWeight: FontWeight.normal,
                                    fontSize: 15)),
                          ),
                        ],
                      ),
                    ],
                  ),
                ],
              ),
            )

Solution

  • The boarder in your MAin container cause this issue, try to remove it:

    Container(
                width: double.infinity,
                height: 330,
                margin: EdgeInsets.fromLTRB(40, 30, 40, 0),
                decoration: BoxDecoration(
                    // border: Border.all(color: Colors.white, width: 5), <--- remove this
                    borderRadius: BorderRadius.all(Radius.circular(10)),
                    color: Colors.white
                ),
    ...
    )
    

    also if you want to rounded that corner too add this to your main container too:

    clipBehavior: Clip.antiAlias,
    

    enter image description here