How do I change my clickable square image into a circular image on Flutter?

Issue

How do I change my clickable square image into a circular image on Flutter?

body: SafeArea(
        child: Center(
          child: Padding(
            padding: const EdgeInsets.all(30.0),
            child: Column(
              children: <Widget>[
                Expanded(
                  child: TextButton(
                    child: Image.asset(
                      'assets/mia.png',
                      height: 250,
                      width: 250,
                    ),
                    onPressed: () {
                      Navigator.push(
                        context,
                        MaterialPageRoute(builder: (context) => Nkunga()),

Solution

If you want to make the image circular, you may use CliRRect with a borderRadius like this:

ClipRRect(
              borderRadius: BorderRadius.circular(80.0),
              child: Image.asset(
                'assets/mia.png',
                height: 250,
                width: 250,
              ),
            ),

Answered By – Edivaldo Marco

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published