-
Notifications
You must be signed in to change notification settings - Fork 3
/
chat_message.dart
40 lines (34 loc) · 1.06 KB
/
chat_message.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import 'package:flutter/material.dart';
import 'user.dart';
const String _name = "SDP";
class ChatMessage extends StatelessWidget{
final String text;
ChatMessage({this.text});
@override
Widget build(BuildContext context){
return new Container(
margin: const EdgeInsets.symmetric(vertical: 10.0),
child: new Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Container(
margin: const EdgeInsets.only(right: 16.0),
child: new CircleAvatar(
child: new Text(_name[0]),
),
),
new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Text(_name, style: Theme.of(context).textTheme.subhead,),
new Container(
margin: const EdgeInsets.only(top: 5.0),
child: new Text(text),
)
],
)
],
)
);
}
}