【问题标题】:RaisedButton widget has linethrowRaisedButton 小部件有 linethrow
【发布时间】:2021-03-29 08:30:35
【问题描述】:

我使用 android studio 开发 Flutter 应用程序,但我遇到了一个问题,即凸起的按钮小部件有一条投掷线 并且它的效果不起作用(colors.blue)

【问题讨论】:

标签: android flutter android-studio


【解决方案1】:

你的情况,你可以试试

ElevatedButton(
        child: Text("Answer1", style: TextStyle(color: Colors.white,fontSize:30)),
        style: ButtonStyle(
          backgroundColor: MaterialStateProperty.all<Color>(Colors.black),
        ),
        onPressed: () {})

【讨论】:

    【解决方案2】:

    'RaisedButton' 已弃用,不应使用。请改用ElevatedButton

    @Deprecated(
      'Use ElevatedButton instead. See the migration guide in flutter.dev/go/material-button-migration-guide). '
      'This feature was deprecated after v1.25.0-8.1.pre.'
    )
    class RaisedButton extends MaterialButton {
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-05-23
      • 2019-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-23
      • 2021-08-22
      • 2021-03-07
      相关资源
      最近更新 更多