You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.5 KiB
47 lines
1.5 KiB
3 years ago
|
import 'package:teso/Classes/ChatMessage.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:time_elapsed/time_elapsed.dart';
|
||
|
|
||
|
buildRecipient(BuildContext context, ChatMessage message) {
|
||
|
return Container(
|
||
|
width: MediaQuery.of(context).size.width,
|
||
|
margin: EdgeInsets.only(
|
||
|
left: 10, top: 20, right: MediaQuery.of(context).size.width * 0.3),
|
||
|
decoration: BoxDecoration(),
|
||
|
child: ClipRRect(
|
||
|
borderRadius: BorderRadius.only(
|
||
|
topLeft: Radius.circular(20.0),
|
||
|
topRight: Radius.circular(10.0),
|
||
|
bottomLeft: Radius.circular(0.0),
|
||
|
bottomRight: Radius.circular(10),
|
||
|
),
|
||
|
child: Align(
|
||
|
alignment: Alignment.centerRight,
|
||
|
child: Container(
|
||
|
padding: EdgeInsets.all(10),
|
||
|
color: Theme.of(context).primaryColor,
|
||
|
child: Wrap(
|
||
|
alignment: WrapAlignment.spaceBetween,
|
||
|
spacing: 10.0,
|
||
|
direction: Axis.horizontal,
|
||
|
children: [
|
||
|
Text(message.content),
|
||
|
Container(
|
||
|
child: Align(
|
||
|
alignment: Alignment.bottomRight,
|
||
|
child: Text(
|
||
|
TimeElapsed.fromDateTime(message.timestamp),
|
||
|
textAlign: TextAlign.right,
|
||
|
style: TextStyle(
|
||
|
fontSize: 10,
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
]),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|