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

Flutter: making InkWell circular

          Container(
            decoration: BoxDecoration(shape: BoxShape.circle),
            child: Material(
              color: Colors.orange,
              child: InkWell(
                splashColor: Colors.black,
                onTap: () {},
                child: Ink(
                  decoration: BoxDecoration(shape: BoxShape.circle),
                  height: Get.height * 0.0425,
                  width: Get.height * 0.0425,
                  child: Icon(Icons.holiday_village),
                ),
              ),
            ),
          ),

I want to make this InkWell stuff circular shape. Nothing seems to make it circular. If I take out Material(), then it shows no background color nor the splash color does not appear. How can I reshape this Contaner – InkWell circular to make sure that the button is circular shape with the splashColor?

>Solution :

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

Use customBorder: CircleBorder(), on InkWell and
shape: const CircleBorder(), on Material

Container(
          decoration: BoxDecoration(
            shape: BoxShape.circle,
          ),
          child: Material(
            color: Colors.orange,
            shape: const CircleBorder(),
            child: InkWell(
              splashColor: Colors.black,
              onTap: () {},
              customBorder: const CircleBorder(),
              child: Ink(
                decoration: const BoxDecoration(shape: BoxShape.circle),
                height: 425,
                width: 425,
                child: const Icon(Icons.holiday_village),
              ),
            ),
          ),
        ),

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