How to remove default margin/spacing from Button Widget in Flutter

VEmpink
Jan 17, 2021

--

Sometimes it’s annoying when components (React) or widgets (Flutter) have some default spacing like margin and padding but for now, I wanna tell you how to remove the default margin/spacing from Button Widget in Flutter like this:

to remove that default margin/spacing Flutter has given us some options with a property called `tapTargetSize` aaand here the example:

ElevatedButton(  child: Text('CREATE'),  style: ButtonStyle(    tapTargetSize: MaterialTapTargetSize.shrinkWrap
),
onPressed: () {},)

that’s it! Done :)

--

--

VEmpink
0 Followers

JavaScript Developer and a fan of React Framework