【发布时间】:2021-05-12 18:59:55
【问题描述】:
我正在开发我的第一个 Flutter 项目,我的目标是让我的应用在所有平台(Android、iOS、Web)上运行。
当我使用 ElevatedButton 时,我的前额慢慢变得更红了。我无法让它在网络上运行。
这是它在 Android 中的样子:(正确)
这是它在网络上的样子:(不正确)
这是我的主题:
theme: ThemeData(
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
primary: Colors.black,
onPrimary: Colors.yellowAccent,
side: BorderSide(width: 2.5, color: Colors.yellowAccent),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
textStyle: TextStyle(
fontSize: 15, fontWeight: FontWeight.w600
),
elevation: 6,
shadowColor: Colors.yellowAccent,
padding: EdgeInsets.all(8.0),
),
),
),
这是我的按钮:
Container(
padding: EdgeInsets.all(8.0),
child: ElevatedButton(
child: Text("MY BUTTON"),
onPressed: () => setState(() {
_launched = _launchInBrowser('https://www.mywonderfulsite.com');
}),
)),
这是 ElevatedButton 的“功能”还是可以使用它来解决?
欣赏建议。
【问题讨论】:
-
我也有同样的问题。刚刚在这里报告了这个错误:github.com/flutter/flutter/issues/98083