修改登陆页面
parent
80b7de4d30
commit
5526ab2d6a
|
|
@ -19,11 +19,15 @@ class _ChattingDetailsPageState extends State<ChattingBuildPage> {
|
|||
void initState() {
|
||||
super.initState();
|
||||
getChattingfriednList();
|
||||
print(11111);
|
||||
}
|
||||
|
||||
getChattingfriednList() async {
|
||||
List<MessageData> messageList = await chattingApi.getChattingList();
|
||||
messageData.addAll(messageList);
|
||||
setState(() {
|
||||
messageData.addAll(messageList);
|
||||
print(messageData);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -32,13 +36,13 @@ class _ChattingDetailsPageState extends State<ChattingBuildPage> {
|
|||
return Scaffold(
|
||||
//构造列表
|
||||
body: ListView.builder(
|
||||
//传入长度
|
||||
itemCount: messageData.length,
|
||||
//构造列表项
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
//传入 messageData 返回 表项
|
||||
return new ChattingItemPage(messageData[index]);
|
||||
},
|
||||
//传入长度
|
||||
itemCount: messageData.length,
|
||||
//构造列表项
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
//传入 messageData 返回 表项
|
||||
return new ChattingItemPage(messageData[index]);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class _ChattingPageState extends State<ChattingPage> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("微信"),
|
||||
|
|
@ -72,7 +73,13 @@ class _ChattingPageState extends State<ChattingPage> {
|
|||
))
|
||||
],
|
||||
),
|
||||
body: ChattingBuildPage()
|
||||
body: ChattingBuildPage(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
chattingApi.getChattingList();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue