You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.9 KiB
Dart

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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,
),
),
],
),
),
);
}
}