通讯录完成
This commit is contained in:
@@ -25,26 +25,53 @@ class _ContactPageState extends State<ContactPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetX<TimFriendService>(
|
||||
builder: (_) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('我的好友(${_.friends.length})'),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
// Get.toNamed(ImRoutes.friendSearch);
|
||||
},
|
||||
icon: const Icon(Icons.search_outlined),
|
||||
),
|
||||
],
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('通讯录'),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
// Get.toNamed(ImRoutes.friendSearch);
|
||||
},
|
||||
icon: const Icon(Icons.search_outlined),
|
||||
),
|
||||
body: AzListView(
|
||||
physics: const ClampingScrollPhysics(),
|
||||
data: _.contacts,
|
||||
itemCount: _.contacts.length,
|
||||
itemBuilder: (__, index) {
|
||||
ContactInfoModel info = _.contacts[index];
|
||||
],
|
||||
),
|
||||
body: GetX<TimFriendService>(builder: (_) {
|
||||
return AzListView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
data: _.contacts,
|
||||
itemCount: _.contacts.length,
|
||||
itemBuilder: (__, index) {
|
||||
ContactInfoModel info = _.contacts[index];
|
||||
if (info.tagIndex == '@') {
|
||||
return Column(
|
||||
children: [
|
||||
ListTile(
|
||||
onTap: () async {},
|
||||
leading: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: info.color!,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Icon(
|
||||
info.icon,
|
||||
size: 26,
|
||||
color: AppColors.white,
|
||||
),
|
||||
),
|
||||
tileColor: AppColors.white,
|
||||
title: Text(info.name),
|
||||
),
|
||||
const Divider(
|
||||
height: 0,
|
||||
indent: 72,
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Column(
|
||||
children: [
|
||||
ListTile(
|
||||
@@ -69,19 +96,22 @@ class _ContactPageState extends State<ContactPage> {
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
susItemBuilder: (__, index) {
|
||||
ContactInfoModel model = _.contacts[index];
|
||||
if ('↑' == model.getSuspensionTag()) {
|
||||
return Container();
|
||||
}
|
||||
return ImTools.susItem(context, model.getSuspensionTag());
|
||||
},
|
||||
indexBarData: SuspensionUtil.getTagIndexList(_.contacts).toList(),
|
||||
indexBarOptions: ImTools.indexBarOptions,
|
||||
),
|
||||
}
|
||||
},
|
||||
susItemBuilder: (__, index) {
|
||||
ContactInfoModel model = _.contacts[index];
|
||||
if ('@' == model.getSuspensionTag()) {
|
||||
return Container();
|
||||
}
|
||||
return ImTools.susItem(
|
||||
context,
|
||||
model.getSuspensionTag(),
|
||||
);
|
||||
},
|
||||
indexBarData: SuspensionUtil.getTagIndexList(_.contacts).toList(),
|
||||
indexBarOptions: ImTools.indexBarOptions,
|
||||
);
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user