Questions tagged [iconbutton]

77 questions
116
votes
11 answers

How do I remove Flutter IconButton big padding?

I want to have a row of IconButtons, all next to each other, but there seems to be pretty big padding between the actual icon, and the IconButton limits. I've already set the padding on the button to 0. This is my component, pretty…
Pablote
  • 4,745
  • 9
  • 39
  • 46
67
votes
18 answers

How to set background color for an icon button?

I want to apply background color for icon button but I don't see an explicit backgroundColor property for it. I want to achieve this: Currently I was able to achieve till here: Below is the code so far: @override Widget build(BuildContext…
Darshan
  • 10,550
  • 5
  • 49
  • 61
6
votes
3 answers

Rotate icon 180 degree with animation in flutter

I have a IconButton, Normally, It's icon is Icons.expand_more but When I press that its icon should be Icons.expand_less. I want to animated this so that if I press that button, it will rotate and point the downwords from upwords. and same when I…
Aayush Shah
  • 584
  • 1
  • 8
  • 17
6
votes
2 answers

Material UI - Custom IconButton with variant props like the real Button

This is my first post so sorry if i forget anything ... For my work i have to use Material UI and i need an IconButton with some contained style like the real Button! I managed to do it with a full copy paste of the Mui Component :…
Xiyitifu
  • 61
  • 1
  • 4
6
votes
5 answers

How change the Icon of an IconButton when it is pressed

I want to know how I can change the Icon of an IconButton when it is pressed. (Favorite_border to Favorite). I tried somethings but it doesn't works. Maybe it is easy but I am a beginner and I don't understand very well how it is…
Rianou
  • 409
  • 2
  • 8
  • 18
5
votes
5 answers

Flutter - How to change IconButtons size with Theme

I have a Row with multiple IconButtons and I need to change their color and size. I managed to change the color, but I'm not able to change the icons size. IconTheme( data: IconThemeData(size: 48.0, color: Colors.yellow), …
matte_colo
  • 335
  • 1
  • 6
  • 18
3
votes
2 answers

Icon not changing on onPressed

I am working on a larger project but do not know why this small part has kept me almost a whole day. import 'package:flutter/material.dart'; void main() { runApp(const AllTests()); } class AllTests extends StatefulWidget { const AllTests({Key?…
3
votes
1 answer

Flutter : Make IconButtons with different Icon sizes and Text elements in Row align to the center

I have this Row widget in Flutter App with some IconButtons Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon(Icons.skip_previous, color: Colors.amber, size: 35), onPressed: () { …
Sermed mayi
  • 697
  • 7
  • 26
2
votes
1 answer

Flutter: is it possible to resize IconButton when it is clicked (onPressed)?

I have a row, whose children are few buttons. I use them to pick color of my item, and when one icon is clicked I save color on server. Now, I would like the chosen Icon to resize (to get bigger). So that it really look like "selected". Do you have…
No Ziffer
  • 45
  • 4
2
votes
1 answer

Avoiding long word breaks

I have an icon button with an icon and the title. The title of the button is coming from API which is a combination of two words or sometimes more than two words. i.e Chinese Restaurants or Mexican restaurants. Sometimes, it breaks the word…
Peter
  • 27
  • 4
2
votes
1 answer

How to place hanging icon in upper right corner of Card composable

How can I achieve the effect shown below in the picture on a Card composable, with the X icon, for instance, hanging in the upper right corner? I don't want the rounded corners nor the black background, just the icon hanging in the upper right…
Raj Narayanan
  • 2,443
  • 4
  • 24
  • 43
2
votes
1 answer

Every button changes at once in listview builder but i want to operate specifically or single how can i do that?

Every button changes at once in listview builder but i want to operate specifically or single how can i do that? This is what happens GIF @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const…
Afthal Ad
  • 91
  • 1
  • 7
2
votes
2 answers

How can I capture the name of the Icon element that's the child of IconButton in Material UI for reference in IconButton's onClick?

I have this IconButton which contains AddCircleIcon: { console.log(e.target.name) …
foamroll
  • 752
  • 7
  • 23
2
votes
3 answers

How to change color in TextButton.icon

I want to have an icon with text, so I used TextButton.icon but I can not change the color of the text or icon! Please suggest if anyone has a solution this is my code: SizedBox(height: 8,), TextButton.icon( icon:…
Saied Rahimi
  • 170
  • 2
  • 8
2
votes
2 answers

How to make Jetpack compose IconButton's width to adapt children's width?

I want to make an IconButton with text below the icon. I have tried applying those width-related methods in Modifier to all the IconButton, Column, Icon and Text. The code below the is closest I got. The result looks like this. And this is what I…
chungchung
  • 85
  • 1
  • 6
1
2 3 4 5 6