【发布时间】:2026-01-25 16:40:02
【问题描述】:
我正在尝试开发一个具有透明背景的屏幕,以显示前一个屏幕(导航堆栈上的前一个屏幕)。
这是我目前所拥有的。我试图通过将 Scaffold 的主体包裹在一个不透明对象中来调整它的不透明度,但这并没有影响背景的不透明度。通过使用屏幕而不是弹出栏或菜单,我可能会以错误的方式处理这个问题 - 我是 Flutter 的新手,可以使用一些指导和建议!谢谢!
return new Scaffold(
body: new Opacity( // This controls the opacity of the buttons.
opacity: 1.0,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
_actionButton('email', '/home'), // _actionButton returns a rounded button with the route to push to the navigation stack.
_actionButton('sms', '/smsRedirect'),
]
),
Row(
children: <Widget>[
_actionButton('jira', '/jiraRedirect'),
_actionButton('slack', '/slackRedirect')
]
),
Row(
children: <Widget>[
_actionButton('override', '/override')
]
),
Row(
children: <Widget>[
_exitButton() // _exitButton returns a button to return to the home screen.
]
)
]
)
)
);
【问题讨论】:
标签: mobile dart flutter opacity transparent