Hello, I'm trying to center my images in the app, but I'm not getting it. What am I doing wrong? How am I going to centralize these images?
InkWell(
child: new Padding(
padding: EdgeInsets.only(top: 50),
child: snapshot.data.Facebook != ""
? Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Align(
alignment: Alignment.bottomCenter,
child: Image.asset(
"assets/images/facebook.png",
height: 30,
),
),
],
)
: Row(
children: <Widget>[],
),
),
onTap: () async {
if (await canLaunch(snapshot.data.Facebook)) {
await launch(snapshot.data.Facebook);
} else {
throw 'erro ao tentar acessar o facebook do(a) $snapshot.data.Nome';
}
}),
I'm stopped at this

Use mainAxisAlignment to align their child to center, spaceAround, spaceBetween, etc .
and mainAxisSize to provide size of mainAxis .
InkWell(
child: new Padding(
padding: EdgeInsets.only(top: 50),
child: snapshot.data.Facebook != ""
?
Row(
mainAxisAlignment : MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Align(
alignment: Alignment.bottomCenter,
child: Image.asset(
"assets/images/facebook.png",
height: 30,
),
),
],
)
: Row(
children: <Widget>[],
),
),
onTap: () async {
if (await canLaunch(snapshot.data.Facebook)) {
await launch(snapshot.data.Facebook);
} else {
throw 'erro ao tentar acessar o facebook do(a) $snapshot.data.Nome';
}
}),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With