Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LLemonGreen opened this issue May 14, 2019 · 0 comments
Open

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

LLemonGreen opened this issue May 14, 2019 · 0 comments

Comments

@LLemonGreen
Copy link

分支: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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant