【发布时间】:2021-05-18 10:46:26
【问题描述】:
我正在构建一个 Flutter 网络应用程序,其中我有一个带有 4 个图标按钮和 1 个作为用户配置文件的 MaterialButton 的菜单界面,如下所示: 我使用灵活来确保没有溢出,但是如果我最小化窗口,图标按钮会溢出,如下所示: 有什么办法可以防止这种情况发生吗?这是我的代码:
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Flexible(
flex: 2,
child: IconButton(
icon: Icon(
Icons.chat_bubble_outline_rounded,
color: Colors.white,
),
onPressed: null),
),
Flexible(
flex: 2,
child: IconButton(
icon: Icon(
Icons.settings_outlined,
color: Colors.white,
),
onPressed: null),
),
Flexible(
flex: 2,
child: IconButton(
icon: Icon(
FontAwesomeIcons.wallet,
color: Colors.white,
),
onPressed: null),
),
Flexible(
flex: 2,
child: IconButton(
icon: Icon(
Icons.notifications_outlined,
color: Colors.white,
),
onPressed: null),
),
MaterialButton(
shape: CircleBorder(),
onPressed: () {
print('click');
},
child: CircleAvatar(
backgroundImage: NetworkImage(user.photoURL.toString()),
),
)
],
),
感谢您的帮助!
【问题讨论】:
标签: flutter user-interface dart flutter-web