28 lines
752 B
Dart
28 lines
752 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:chatting/chatting_data_page.dart';
|
|
import 'package:chatting/chatting_item_page.dart';
|
|
|
|
|
|
class ChattingBuildPage extends StatefulWidget {
|
|
@override
|
|
_ChattingDetailsPageState createState() => _ChattingDetailsPageState();
|
|
}
|
|
|
|
class _ChattingDetailsPageState extends State<ChattingBuildPage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
//构造列表
|
|
body: ListView.builder(
|
|
//传入长度
|
|
itemCount: messageData.length,
|
|
//构造列表项
|
|
itemBuilder: (BuildContext context,int index){
|
|
//传入 messageData 返回 表项
|
|
return new ChattingItemPage(messageData[index]);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|