属性
- radius: 100, // 半径 radius 不能与minRadius 和maxRadius共存,minRadius和maxRadius二者可以一起存在
- minRadius: 50,// 最小半径
- maxRadius: 150,// 最大半径
- backgroundColor: Colors.black12,// 背景色 优先级比backgroundImage低
- backgroundImage: AssetImage("images/avatar3.jpg"),// 背景图片 在child下方
- foregroundColor: Colors.orange[200],// 前景色 在child上方
- child: Text('sss',style: TextStyle(fontSize: 25),),//内部显示的widget

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 50),
child: CircleAvatar(
radius: 100,
backgroundColor: Colors.black12,
backgroundImage: AssetImage("images/avatar3.jpg"),
foregroundColor: Colors.orange[200],
child: Text('sss',style: TextStyle(fontSize: 25),),
),
),
),
);
}
}