Issue
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
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();
}
)
Answered By - saurabh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.