Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to make border on FloatingActionButton?

my problem is i want to do border around my floatingactionbutton. I tried to put it into container and do like this, but it’s not what i want.

        decoration: BoxDecoration(
            border: Border.all(
                color: Colors.brown, width: 5, style: BorderStyle.solid)),
        margin: const EdgeInsets.fromLTRB(0, 0, 0, 55),
        width: 80,
        height: 80,
        child: FloatingActionButton(
          focusColor: Colors.white54,
          backgroundColor: Colors.white,
          onPressed: () {},
          child: const Icon(
            Icons.add,
            color: Colors.black,
            size: 50,
          ),
        ),
      ),

I have this:

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I want this:

enter image description here

>Solution :

just use shape: BoxShape.circle,

Container(
      decoration: BoxDecoration(
        shape: BoxShape.circle,
          border: Border.all(
              color: Colors.brown, width: 5, style: BorderStyle.solid)),
      margin: const EdgeInsets.fromLTRB(0, 0, 0, 55),
      width: 80,
      height: 80,
      child: FloatingActionButton(
        focusColor: Colors.white54,
        backgroundColor: Colors.white,
        onPressed: () {},
        child: const Icon(
          Icons.add,
          color: Colors.black,
          size: 50,
        ),
      ),

    )

output:

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading