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 – How to use icon and url launcher?

I’m learning flutter by my own and I would like to make an icon that works with url_launcher but I have no idea how to do it.
When I’m using icon, onTap doesn’t work. How can I solve this issue?

Row(
  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  children: const [
    Icon(
      Icons.facebook_outlined,
      size: 80,
      color: Colors.black,
    )
  ],
),

>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

You can use Gesturedecture or IconButton

  Row(
      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
      children: [
        GestureDetector(
         onTap:(){
          launchUrl();
        }
         child:Icon(
          Icons.facebook_outlined,
          size: 80,
          color: Colors.black,
        )
       )
      ],
    )

IconButton

IconButton(
icon: Icon(
      Icons.facebook_outlined,
      size: 80,
      color: Colors.black,
    ),
onPressed:(){
 launchUrl();
}

)
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