|
|
|
|
|
|
using Unity.UIWidgets.widgets; |
|
|
|
using UnityEditor.Build.Content; |
|
|
|
using UnityEngine; |
|
|
|
using Color = Unity.UIWidgets.ui.Color; |
|
|
|
using Random = System.Random; |
|
|
|
using TextStyle = Unity.UIWidgets.ui.TextStyle; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override Widget build(BuildContext context) |
|
|
|
{ |
|
|
|
// return new Container(
|
|
|
|
// color: Color.fromARGB(0, 0, 0, 0),
|
|
|
|
// child: new Chat(
|
|
|
|
// messages: _messages,
|
|
|
|
// onAttachmentPressed: _handleAtachmentPressed,
|
|
|
|
// onMessageTap: _handleMessageTap,
|
|
|
|
// onPreviewDataFetched: (
|
|
|
|
// previewData,
|
|
|
|
// message) =>
|
|
|
|
// {
|
|
|
|
// _handlePreviewDataFetched(message, previewData);
|
|
|
|
// },
|
|
|
|
// onTextChanged: (_str) => { },
|
|
|
|
// onSendPressed: _handleSendPressed,
|
|
|
|
// onEndReached: _handleEndReached,
|
|
|
|
// //onEndReachedThreshold: 0.65f,
|
|
|
|
// user: _user
|
|
|
|
// )
|
|
|
|
// );
|
|
|
|
return new Container( |
|
|
|
child: new Chat( |
|
|
|
messages: _messages, |
|
|
|
onAttachmentPressed: _handleAtachmentPressed, |
|
|
|
onMessageTap: _handleMessageTap, |
|
|
|
onPreviewDataFetched: ( |
|
|
|
previewData, |
|
|
|
message)=> |
|
|
|
{ |
|
|
|
_handlePreviewDataFetched(message,previewData); |
|
|
|
}, |
|
|
|
onTextChanged : (_str) => { }, |
|
|
|
onSendPressed: _handleSendPressed, |
|
|
|
onEndReached: _handleEndReached, |
|
|
|
//onEndReachedThreshold: 0.65f,
|
|
|
|
user: _user |
|
|
|
) |
|
|
|
|
|
|
|
return new MaterialApp( |
|
|
|
home: new Scaffold( |
|
|
|
backgroundColor:Color.fromARGB(0,0,0,0), |
|
|
|
appBar: new AppBar( |
|
|
|
backgroundColor: Color.white, |
|
|
|
title: new IconButton( |
|
|
|
icon: new Icon(Icons.arrow_back, color: Color.black), |
|
|
|
onPressed: () => { ChatPanelManager.Switch(); }, |
|
|
|
padding: EdgeInsets.zero |
|
|
|
) |
|
|
|
), |
|
|
|
body: new Container( |
|
|
|
child: new Chat( |
|
|
|
messages: _messages, |
|
|
|
onAttachmentPressed: _handleAtachmentPressed, |
|
|
|
onMessageTap: _handleMessageTap, |
|
|
|
onPreviewDataFetched: ( |
|
|
|
previewData, |
|
|
|
message) => |
|
|
|
{ |
|
|
|
_handlePreviewDataFetched(message, previewData); |
|
|
|
}, |
|
|
|
onTextChanged: (_str) => { }, |
|
|
|
onSendPressed: _handleSendPressed, |
|
|
|
onEndReached: _handleEndReached, |
|
|
|
//onEndReachedThreshold: 0.65f,
|
|
|
|
user: _user |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
} |
|
|
|
} |