ninghao_flutter icon indicating copy to clipboard operation
ninghao_flutter copied to clipboard

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

Open LLemonGreen opened this issue 5 years ago • 0 comments

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

LLemonGreen avatar May 14 '19 06:05 LLemonGreen