I cannot work out why this text is not centering inside the button:
SizedBox(
width: 30,
height: 30,
child: ElevatedButton(
onPressed: () {
FavourDown();
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.black, // background color
elevation: 5,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20), // button's shape
),
),
child: const Text(
'-',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
),
),
),
),
Result:
EDIT:
FULL ANSWER:
Material(
elevation: 20,
child: InkWell(
onTap: () {
FavourUp();
},
child: Container(
width: 30,
height: 30,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.black,
),
child: Center(
child: Text(
'+',
style:TextStyle(
color: Colors.white,
),
),
),
),
),
),