|
|
import 'package:flutter/material.dart';
|
|
|
import 'message_content.dart';
|
|
|
import '../../../components/hyxx_data_handle.dart';
|
|
|
import '../../../components/customDialogG.dart';
|
|
|
|
|
|
class MessagesOutbox extends StatefulWidget {
|
|
|
MessagesOutbox({Key key}) : super(key: key);
|
|
|
|
|
|
_LoginPageState createState() => _LoginPageState();
|
|
|
}
|
|
|
|
|
|
class _LoginPageState extends State<MessagesOutbox> {
|
|
|
Widget _getListTile(BuildContext context, index) {
|
|
|
return Column(
|
|
|
children: <Widget>[
|
|
|
ListTile(
|
|
|
//leading: new Icon(Icons.phone),
|
|
|
title: new Text(listMessagesOutbox2[index]['date'],
|
|
|
style: TextStyle(fontSize: 10)),
|
|
|
subtitle: Text(listMessagesOutbox2[index]['time'],
|
|
|
style: TextStyle(fontSize: 10)),
|
|
|
trailing: Container(
|
|
|
width: 260,
|
|
|
child: Text(
|
|
|
listMessagesOutbox2[index]['title'],
|
|
|
maxLines: 1,
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
//textAlign: TextAlign.right,
|
|
|
style: TextStyle(fontSize: 16),
|
|
|
),
|
|
|
),
|
|
|
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 0),
|
|
|
enabled: true,
|
|
|
onTap: () {
|
|
|
// Navigator.of(context).push(MaterialPageRoute(
|
|
|
// builder: (context) => MessagesView(
|
|
|
// title: '发送的消息', mapData: listMessagesOutbox2[index])));
|
|
|
|
|
|
Navigator.of(context).push(
|
|
|
MaterialPageRoute(
|
|
|
builder: (context) => MessagesView(
|
|
|
title: '发送的消息',
|
|
|
listIndex: index),
|
|
|
),
|
|
|
);
|
|
|
|
|
|
// Navigator.push(context, MaterialPageRoute(builder: (context) {
|
|
|
// return MessagesOutbox(
|
|
|
// title: "PeakPlayer帮助信息", mapData: listMessagesOutbox2[index]);
|
|
|
// }));
|
|
|
},
|
|
|
onLongPress: () {
|
|
|
bFlash = false;
|
|
|
Navigator.of(context).push(
|
|
|
PageRouteBuilder(
|
|
|
opaque: false,
|
|
|
pageBuilder: (context, animation, secondaryAnimation) =>
|
|
|
customDialogG(title: '发送的消息', index: index),
|
|
|
),
|
|
|
).then((value) {
|
|
|
print('Page2_Contacts bFlash = $bFlash');
|
|
|
if (bFlash) {
|
|
|
setState(() {});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
),
|
|
|
Divider(
|
|
|
height: 1.0,
|
|
|
),
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
body: Container(
|
|
|
child: Column(
|
|
|
children: <Widget>[
|
|
|
Expanded(
|
|
|
//Flutter Column套ListView不显示,可将ListView用Expanded包裹起来。
|
|
|
child: ListView.builder(
|
|
|
itemCount: listMessagesOutbox2.length,
|
|
|
itemBuilder: _getListTile,
|
|
|
),
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
}
|