我希望将所有行项均匀地放置在一行中,就像align-Item : center在html中所做的那样.
我的项目是下面的图像,但图像没有与按钮对齐. 纽扣比图片高一点.
我的密码是:
import 'package:flutter/material.dart';
class Home extends StatelessWidget {
const Home({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
Row(
children: [
Spacer(),
ElevatedButton(
onPressed: (() {}),
child: Text("Report"),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xffffb200),
foregroundColor: Color(0xff00324B)),
),
Spacer(),
ElevatedButton(
onPressed: (() {}),
child: Text("Donate"),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xffffb200),
foregroundColor: Color(0xff00324B)),
),
Spacer(),
ElevatedButton(
onPressed: (() {}),
child: Text("Adopt"),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xffffb200),
foregroundColor: Color(0xff00324B)),
),
Spacer(),
Container(
margin: EdgeInsets.fromLTRB(0, 30, 0, 10),
height: 60.0,
width: 60.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(95),
image: DecorationImage(
image: AssetImage("assets/images/download.jpg"),
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 14,
)
],
),
],
),
);
}
}
我甚至试了mainAxisAlignment: MainAxisAlignment.center
以及crossAxisAlignment: CrossAxisAlignment.center美元,但都不起作用.