我试图在颤动中创建一个弯曲的按钮。但对我来说borderRadius标签不起作用。这是我的代码
//Login Button
final loginButton = Padding(
padding: EdgeInsets.symmetric(vertical: 16.0),
child: Material(
borderRadius: BorderRadius.circular(30.0),
shadowColor: Colors.lightBlueAccent.shade100,
elevation: 5.0,
child: MaterialButton(
minWidth: 200.0,
height: 42.0,
onPressed: () {
// Navigator.of(context).pushNamed(HomePage.tag);
},
color: Colors.lightBlueAccent,
child: Text('Log In', style: TextStyle(color: Colors.white)),
),
),
);
我没有得到我错误的地方。
//Login Button
final loginButton = Padding(
padding: EdgeInsets.symmetric(vertical: 16.0),
child: Material(
borderRadius: BorderRadius.circular(30.0),
shadowColor: Colors.lightBlueAccent.shade100,
elevation: 5.0,
Colors.lightBlueAccent,
child: MaterialButton(
minWidth: 200.0,
height: 42.0,
onPressed: () {
// Navigator.of(context).pushNamed(HomePage.tag);
},
child: Text('Log In', style: TextStyle(color: Colors.white)),
),
),
);
尝试上面的代码我将颜色标签从MaterialButton中移出到Material小部件中。我测试了它,它在Flutter dev v0.7.1中的工作原理。我不能再帮助了,除非你通过什么不起作用以及你期望它如何工作来解释你的意思。