SizedBox(
width: 20,
height: 20,
child: FloatingActionButton(
onPressed: null,
child: Icon(Icons.add),
),
),
I want to size Button and also want to put the ICON to center position, but it aligns bottomright little bit… how can I do it? (button size should be 20×20)
my code result picture
>Solution :
Try to use Container instead of SizedBox and set Alignment.center, refer Align:
Container(
alignment: Alignment.center,
width: 20,
height: 20,
child: FloatingActionButton(
onPressed: null,
child: Icon(
Icons.add,
size: 15,
),
),
),
Other way:
FloatingActionButton(
onPressed: null,
child: Icon(Icons.add),
),


