Padding(
padding: const EdgeInsets.symmetric(horizontal: 80.0),
child: RaisedButton(
onPressed:() {
Navigator.push(context, MaterialPageRoute(builder: (context) => SecondPage()),
);
},
child: Container(
margin: EdgeInsets.symmetric(vertical: 0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Color.fromRGBO(49, 39, 79, 1),
),
child: Center(
child: Text(
"Login", style: TextStyle(color: Colors.white),),
)
)
))]),
您可以从代码中看到,UI登录容器位于按钮的前面,但是尺寸非常小。无论如何,我可以将所有这些捆绑在一起吗?
这是您要寻找的吗?
Padding(
padding: const EdgeInsets.symmetric(horizontal: 80.0),
child: RaisedButton(
color: Color.fromRGBO(49, 39, 79, 1),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Scaffold()),
);
},
child: Center(
child: Text(
"Login",
style: TextStyle(color: Colors.white),
),
)
)
)
您在寻找这个吗?
FlatButton(
child: Container(
height: 80.0,
child: Center(
child: Text(
"Login",
style: TextStyle(color: Colors.white),
),
),
padding: const EdgeInsets.symmetric(horizontal: 80.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Color.fromRGBO(49, 39, 79, 1),
),
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SecondPage()),
);
},
),