Skip to content

buttonColor: Theme.of(context).accentColor 设置无效 #2

@LLemonGreen

Description

@LLemonGreen

分支:material-components

button_demo.dart

line30 buttonColor: Theme.of(context).accentColor 设置无效

buttonColor放在 buttonTheme: ButtonThemeData( 下设置生效

Theme(
                  data: Theme.of(context).copyWith(
                    // buttonColor: Theme.of(context).accentColor,
                    buttonTheme: ButtonThemeData(
                      buttonColor: Theme.of(context).accentColor,
                      textTheme: ButtonTextTheme.primary,
                      // shape: BeveledRectangleBorder(
                      //   borderRadius: BorderRadius.circular(5.0),
                      // )
                      shape:StadiumBorder(),
                    ),
                  ),
                  child: RaisedButton(
                  child: Text('Button'),
                  onPressed: () {},
                  splashColor: Colors.grey,
                  elevation: 0.0,
                  // color: Theme.of(context).accentColor,
                  // textColor: Colors.white,
                  // textTheme: ButtonTextTheme.primary,
                ),
                ),

当前flutter版本:Flutter (Channel beta, v1.5.4-hotfix.2, on Mac OS X 10.14.4 18E226, locale zh-Hans-CN)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions