-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathchat_widget.dart
63 lines (61 loc) · 2.06 KB
/
chat_widget.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables
import 'package:flutter/material.dart';
import 'package:kuch_bhi_ai/constants/constants.dart';
import 'package:kuch_bhi_ai/services/assets_manager.dart';
import 'package:kuch_bhi_ai/widgets/text_widget.dart';
class ChatWidget extends StatelessWidget {
ChatWidget({required this.msg, required this.chatIndex});
final String msg;
final int chatIndex;
@override
Widget build(BuildContext context) {
return Column(
children: [
// Material(
Container(
color: chatIndex == 0 ? kScaffoldBackgroundColor : kCardColor,
child: Padding(
padding: EdgeInsets.all(8),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
chatIndex == 0 ? AssetsManager.userImage : AssetsManager.logo,
height: 20,
width: 20,
),
SizedBox(
width: 8,
),
Expanded(
child: TextWidget(
label: msg,
),
),
chatIndex == 0
? SizedBox.shrink()
: Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.thumb_up_alt_outlined,
color: Colors.white,
),
SizedBox(
width: 5,
),
Icon(
Icons.thumb_down_alt_outlined,
color: Colors.white,
),
],
),
],
),
),
),
],
);
}
}