Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
22_23-J 50
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23-J 50
22_23-J 50
Commits
f95c2d66
Commit
f95c2d66
authored
May 09, 2023
by
Yasiru-Deshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Message component added
parent
2f583c5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
Frontend/AI-Chat-Bot/lib/Messages.dart
Frontend/AI-Chat-Bot/lib/Messages.dart
+48
-0
No files found.
Frontend/AI-Chat-Bot/lib/Messages.dart
0 → 100644
View file @
f95c2d66
import
'package:flutter/material.dart'
;
class
MessagesScreen
extends
StatefulWidget
{
final
List
messages
;
const
MessagesScreen
({
Key
?
key
,
required
this
.
messages
})
:
super
(
key:
key
);
@override
_MessagesScreenState
createState
()
=>
_MessagesScreenState
();
}
class
_MessagesScreenState
extends
State
<
MessagesScreen
>
{
@override
Widget
build
(
BuildContext
context
)
{
var
w
=
MediaQuery
.
of
(
context
).
size
.
width
;
return
ListView
.
separated
(
itemBuilder:
(
context
,
index
)
{
return
Row
(
mainAxisAlignment:
widget
.
messages
[
index
][
'isUserMessage'
]
?
MainAxisAlignment
.
end
:
MainAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
14
,
horizontal:
14
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
only
(
bottomLeft:
Radius
.
circular
(
20
,
),
topRight:
Radius
.
circular
(
20
),
bottomRight:
Radius
.
circular
(
widget
.
messages
[
index
][
'isUserMessage'
]
?
0
:
20
),
topLeft:
Radius
.
circular
(
widget
.
messages
[
index
][
'isUserMessage'
]
?
20
:
0
),
),
color:
widget
.
messages
[
index
][
'isUserMessage'
]
?
Colors
.
grey
.
shade800
:
Colors
.
grey
.
shade900
.
withOpacity
(
0.8
)),
constraints:
BoxConstraints
(
maxWidth:
w
*
2
/
3
),
child:
Text
(
widget
.
messages
[
index
][
'message'
].
text
.
text
[
0
])),
],
);
},
separatorBuilder:
(
_
,
i
)
=>
Padding
(
padding:
EdgeInsets
.
only
(
top:
10
)),
itemCount:
widget
.
messages
.
length
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment