feat:更新页面颜色
This commit is contained in:
@@ -40,86 +40,26 @@ class _ContactsPageState extends State<ContactsPage> {
|
||||
|
||||
void _loadFakeData() {
|
||||
contactList = [
|
||||
ContactInfo(
|
||||
name: '张三',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/11.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '李四',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/12.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '王五',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/13.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '赵六',
|
||||
avatar: 'https://randomuser.me/api/portraits/women/14.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '陈七',
|
||||
avatar: 'https://randomuser.me/api/portraits/women/15.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '刘八',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/16.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '周九',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/17.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '吴十',
|
||||
avatar: 'https://randomuser.me/api/portraits/women/18.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '欧阳峰',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/21.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '诸葛青',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/22.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '司马光',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/23.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '慕容复',
|
||||
avatar: 'https://randomuser.me/api/portraits/women/24.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '安琪拉',
|
||||
avatar: 'https://randomuser.me/api/portraits/women/31.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '亚瑟',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/32.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '李白',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/33.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '韩信',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/34.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '孙尚香',
|
||||
avatar: 'https://randomuser.me/api/portraits/women/35.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '鲁班',
|
||||
avatar: 'https://randomuser.me/api/portraits/men/36.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '妲己',
|
||||
avatar: 'https://randomuser.me/api/portraits/women/37.jpg',
|
||||
),
|
||||
ContactInfo(
|
||||
name: '甄姬',
|
||||
avatar: 'https://randomuser.me/api/portraits/women/38.jpg',
|
||||
),
|
||||
ContactInfo(name: '张三', avatar: 'https://picsum.photos/id/1011/200'),
|
||||
ContactInfo(name: '李四', avatar: 'https://picsum.photos/id/1012/200'),
|
||||
ContactInfo(name: '王五', avatar: 'https://picsum.photos/id/1013/200'),
|
||||
ContactInfo(name: '赵六', avatar: 'https://picsum.photos/id/1014/200'),
|
||||
ContactInfo(name: '陈七', avatar: 'https://picsum.photos/id/1015/200'),
|
||||
ContactInfo(name: '刘八', avatar: 'https://picsum.photos/id/1016/200'),
|
||||
ContactInfo(name: '周九', avatar: 'https://picsum.photos/id/1017/200'),
|
||||
ContactInfo(name: '吴十', avatar: 'https://picsum.photos/id/1018/200'),
|
||||
ContactInfo(name: '欧阳峰', avatar: 'https://picsum.photos/id/1021/200'),
|
||||
ContactInfo(name: '诸葛青', avatar: 'https://picsum.photos/id/1022/200'),
|
||||
ContactInfo(name: '司马光', avatar: 'https://picsum.photos/id/1023/200'),
|
||||
ContactInfo(name: '慕容复', avatar: 'https://picsum.photos/id/1024/200'),
|
||||
ContactInfo(name: '安琪拉', avatar: 'https://picsum.photos/id/1031/200'),
|
||||
ContactInfo(name: '亚瑟', avatar: 'https://picsum.photos/id/1032/200'),
|
||||
ContactInfo(name: '李白', avatar: 'https://picsum.photos/id/1033/200'),
|
||||
ContactInfo(name: '韩信', avatar: 'https://picsum.photos/id/1034/200'),
|
||||
ContactInfo(name: '孙尚香', avatar: 'https://picsum.photos/id/1035/200'),
|
||||
ContactInfo(name: '鲁班', avatar: 'https://picsum.photos/id/1036/200'),
|
||||
ContactInfo(name: '妲己', avatar: 'https://picsum.photos/id/1037/200'),
|
||||
ContactInfo(name: '甄姬', avatar: 'https://picsum.photos/id/1038/200'),
|
||||
];
|
||||
|
||||
_handleList(contactList);
|
||||
@@ -142,27 +82,31 @@ class _ContactsPageState extends State<ContactsPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF2F2F7),
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: Colors.grey.shade200,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
title: const Text(
|
||||
'通讯录',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF1C1C1E),
|
||||
),
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: _buildAppBar(),
|
||||
body: Column(
|
||||
children: [_buildSearchBar(), Expanded(child: _buildAzListView())],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
PreferredSizeWidget _buildAppBar() {
|
||||
return AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: Color(0xFF120D25),
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
title: const Text(
|
||||
'通讯录',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAzListView() {
|
||||
return AzListView(
|
||||
data: contactList,
|
||||
@@ -170,7 +114,6 @@ class _ContactsPageState extends State<ContactsPage> {
|
||||
itemBuilder: (_, index) {
|
||||
final c = contactList[index];
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundImage: NetworkImage(c.avatar),
|
||||
@@ -178,7 +121,7 @@ class _ContactsPageState extends State<ContactsPage> {
|
||||
),
|
||||
title: Text(
|
||||
c.name,
|
||||
style: const TextStyle(fontSize: 16, color: Color(0xFF1C1C1E)),
|
||||
style: const TextStyle(fontSize: 16, color: Colors.white),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -189,10 +132,10 @@ class _ContactsPageState extends State<ContactsPage> {
|
||||
height: 28,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
alignment: Alignment.centerLeft,
|
||||
color: const Color(0xFFF2F2F7),
|
||||
color: const Color(0xFF2B2744),
|
||||
child: Text(
|
||||
tag,
|
||||
style: const TextStyle(fontSize: 13, color: Color(0xFF8E8E93)),
|
||||
style: const TextStyle(fontSize: 13, color: Colors.grey),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -210,21 +153,16 @@ class _ContactsPageState extends State<ContactsPage> {
|
||||
Widget _buildSearchBar() {
|
||||
return Container(
|
||||
height: 44,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
),
|
||||
decoration: BoxDecoration(color: Color(0xFF2F2A47)),
|
||||
child: TextField(
|
||||
textAlignVertical: TextAlignVertical.center,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
hintText: '搜索联系人',
|
||||
hintStyle: const TextStyle(fontSize: 15, color: Color(0xFF8E8E93)),
|
||||
prefixIcon: const Icon(
|
||||
Icons.search,
|
||||
size: 20,
|
||||
color: Color(0xFF8E8E93),
|
||||
),
|
||||
hintStyle: const TextStyle(fontSize: 15, color: Colors.white),
|
||||
prefixIcon: const Icon(Icons.search, size: 20, color: Colors.white),
|
||||
border: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user