Flutter 《颤栗》中怪异的黑色背景';s大纲按钮小部件

Flutter 《颤栗》中怪异的黑色背景';s大纲按钮小部件,flutter,flutter-layout,Flutter,Flutter Layout,我使用的是Flitter的OutlineButton小部件,我不知道如何在点击/按下按钮时删除奇怪的黑色背景突出显示 这是按钮: OutlineButton( highlightElevation: 1.0, onPressed: () => onRequestAllowLocation(context), child: Text( "ALLOW LOCATION", style: TextStyle(fontWeight: FontWeight.w600,

我使用的是Flitter的OutlineButton小部件,我不知道如何在点击/按下按钮时删除奇怪的黑色背景突出显示

这是按钮:

OutlineButton(
  highlightElevation: 1.0,
  onPressed: () => onRequestAllowLocation(context),
  child: Text(
    "ALLOW LOCATION",
    style: TextStyle(fontWeight: FontWeight.w600, fontSize: 16),
  ),
  borderSide: BorderSide(color: MyApp.accentColor, width: 2.0),
  textColor: MyApp.accentColor,
  shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(16.0))),
)
以下是该应用程序的主题:

ThemeData(
  fontFamily: 'Dosis',
  brightness: Brightness.dark,
  primarySwatch: Colors.blue,
  accentColor: accentColor,
  highlightColor: highlightColor,
  buttonColor: accentColor,
  indicatorColor: accentColor,
  backgroundColor: primaryColor,
  scaffoldBackgroundColor: primaryColor,
  primaryColor: primaryColor,
)

另外,我上面提供的
const
颜色都不是黑色。

是阴影。停止设置highlightElevation,它将消失。发件人:

默认情况下,按钮的highlightElevation(定义按下按钮时放置阴影的大小)为0.0(无阴影)。如果为highlightElevation指定的值大于0.0,则该按钮将成为RaisedButton和FlatButton之间的交叉点:一个带边框的按钮,当按下该按钮时,其高程将增加,背景将变得不透明