Flutter Widget之CircleAvatar

Widget:https://flutter.io/docs/development/ui/widgets
CircleAvatar:https://docs.flutter.io/flutter/material/CircleAvatar-class.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import 'package:flutter/material.dart';

class CircleAvatarDemoPage extends StatefulWidget {
@override
State<StatefulWidget> createState() => new _CircleAvatarDemoPagePageState();
}

class _CircleAvatarDemoPagePageState extends State<CircleAvatarDemoPage> {
@override
void initState() {
super.initState();
}

Widget build(BuildContext context) {
return Scaffold(
appBar: new AppBar(
title: new Text('CircleAvatar Demo'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircleAvatar(
backgroundImage: NetworkImage('http://www.yezhou.me/images/flutter/tangyixin.jpg'),
radius: 60,
),
SizedBox(height: 10),
CircleAvatar(
backgroundColor: Colors.brown.shade800,
child: Text('Joe.Ye'),
radius: 40,
)
],
)
)
);
}
}

Flutter Widget CircleAvatar

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :