Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
// crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
FloatingActionButton(
onPressed: () {
//ClearSession();
if (Navigator.canPop(context)) {
Navigator.pop(context, true);
}
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) =>
Home(22.0, 22.0)));
}
// Add your onPressed code here!
,
backgroundColor: Colors.green,
child: const Icon(Icons.home),
),
FloatingActionButton(
onPressed: () {
//ClearSession();
if (Navigator.canPop(context)) {
Navigator.pop(context, true);
}
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) =>
const Calender()));
}
// Add your onPressed code here!
,
backgroundColor: Colors.green,
child: const Icon(Icons.calendar_month),
),
FloatingActionButton(
onPressed: () {
//ClearSession();
if (Navigator.canPop(context)) {
Navigator.pop(context, true);
}
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) =>
const Community()));
},
backgroundColor: Colors.green,
child: const Icon(Icons.article_rounded),
),
FloatingActionButton(
onPressed: () {
// Add your onPressed code here!
},
backgroundColor: Colors.green,
child: const Icon(
Icons.settings_accessibility_sharp),
),
],
),
],
),
它应该与所有类型的屏幕兼容,无论屏幕大小我不想使用填充,因为它只适用于某些屏幕,而不是所有类型的屏幕图标都在屏幕的中间,
我想把它们都放在屏幕的按钮上
它应该与所有类型的屏幕兼容,无论屏幕大小我不想使用填充,因为它只适用于某些屏幕,而不是所有类型的屏幕图标都在屏幕的中间,我想把所有的屏幕按钮
2条答案
按热度按时间vnzz0bqm1#
使用
scaffold()
,然后将Row()
放入floatingActionButton
属性中,如下所示:bvuwiixz2#
您可以使用bottomNavigationBar轻松放置所有按钮,bottomNavigationBar是scaffold小部件可用的属性