##Text学习
class TextDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
color: Colors.green,
child: Text(
"文本",
maxLines: 1,
overflow: TextOverflow.ellipsis,
textDirection: TextDirection.rtl,
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white),
),
);
}
}
##Button学习
class ButtonDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
children: [
ElevatedButton(
onPressed: () {},
child: Text('漂浮按钮'),
),
TextButton(
onPressed: () {},
child: Text("漂浮按钮"),
),
TextButton.icon(
label: Text("data"),
onPressed: () {},
icon: Icon(Icons.add),
style: TextButton.styleFrom(backgroundColor: Colors.red)),
OutlinedButton(onPressed: () {}, child: Text("OutlinedButton")),
IconButton(onPressed: () {}, icon: Icon(Icons.home))
],
);
}
}