update ui text colour
Browse files
misinformationui/lib/chat_screen.dart
CHANGED
|
@@ -209,10 +209,18 @@ Future<void> _sendMessage() async {
|
|
| 209 |
child: Row(
|
| 210 |
children: [
|
| 211 |
Expanded(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
child: TextField(
|
| 213 |
controller: _controller,
|
| 214 |
-
|
| 215 |
-
|
|
|
|
| 216 |
decoration: const InputDecoration(
|
| 217 |
hintText: 'Type an info to verify...',
|
| 218 |
hintStyle: TextStyle(color: Colors.grey),
|
|
@@ -220,6 +228,7 @@ Future<void> _sendMessage() async {
|
|
| 220 |
),
|
| 221 |
onSubmitted: (_) => _sendMessage(),
|
| 222 |
),
|
|
|
|
| 223 |
),
|
| 224 |
IconButton(
|
| 225 |
icon: const Icon(Icons.send, color: Colors.white),
|
|
@@ -252,45 +261,52 @@ class MessageBubble extends StatelessWidget {
|
|
| 252 |
Widget build(BuildContext context) {
|
| 253 |
return Align(
|
| 254 |
alignment: message.isUser ? Alignment.centerRight : Alignment.centerLeft,
|
| 255 |
-
child:
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
)
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
isCompleted: message.isStepCompleted ?? false,
|
| 275 |
-
)
|
| 276 |
-
: message.isPreFormatted
|
| 277 |
-
? SelectableLinkify(
|
| 278 |
-
text: message.text,
|
| 279 |
-
onOpen: _onOpen,
|
| 280 |
-
linkStyle: const TextStyle(
|
| 281 |
-
color: Colors.blueAccent,
|
| 282 |
-
decoration: TextDecoration.underline
|
| 283 |
-
),
|
| 284 |
-
style: const TextStyle(
|
| 285 |
-
fontFamily: 'Montserrat',
|
| 286 |
-
fontSize: 16,
|
| 287 |
-
color: Colors.white,
|
| 288 |
-
),
|
| 289 |
-
)
|
| 290 |
-
: Text(
|
| 291 |
-
message.text,
|
| 292 |
-
style: const TextStyle(color: Colors.white),
|
| 293 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
),
|
| 295 |
);
|
| 296 |
}
|
|
|
|
| 209 |
child: Row(
|
| 210 |
children: [
|
| 211 |
Expanded(
|
| 212 |
+
child: Theme(
|
| 213 |
+
data: ThemeData(
|
| 214 |
+
textSelectionTheme: TextSelectionThemeData(
|
| 215 |
+
selectionColor: Colors.grey.withOpacity(0.5),
|
| 216 |
+
cursorColor: Colors.white,
|
| 217 |
+
)
|
| 218 |
+
),
|
| 219 |
child: TextField(
|
| 220 |
controller: _controller,
|
| 221 |
+
style: const TextStyle(
|
| 222 |
+
color: Colors.white,
|
| 223 |
+
),
|
| 224 |
decoration: const InputDecoration(
|
| 225 |
hintText: 'Type an info to verify...',
|
| 226 |
hintStyle: TextStyle(color: Colors.grey),
|
|
|
|
| 228 |
),
|
| 229 |
onSubmitted: (_) => _sendMessage(),
|
| 230 |
),
|
| 231 |
+
),
|
| 232 |
),
|
| 233 |
IconButton(
|
| 234 |
icon: const Icon(Icons.send, color: Colors.white),
|
|
|
|
| 261 |
Widget build(BuildContext context) {
|
| 262 |
return Align(
|
| 263 |
alignment: message.isUser ? Alignment.centerRight : Alignment.centerLeft,
|
| 264 |
+
child: Theme(data: ThemeData(
|
| 265 |
+
textSelectionTheme: TextSelectionThemeData(
|
| 266 |
+
selectionColor: Colors.grey.withOpacity(0.5),
|
| 267 |
+
)
|
| 268 |
+
),
|
| 269 |
+
child: Container(
|
| 270 |
+
constraints: BoxConstraints(
|
| 271 |
+
maxWidth: MediaQuery.of(context).size.width * 0.8,
|
| 272 |
+
),
|
| 273 |
+
margin: const EdgeInsets.only(bottom: 4),
|
| 274 |
+
padding: const EdgeInsets.all(10),
|
| 275 |
+
decoration: message.isUser
|
| 276 |
+
? BoxDecoration(
|
| 277 |
+
color: const Color(0xFF414141),
|
| 278 |
+
borderRadius: BorderRadius.only(
|
| 279 |
+
topLeft: const Radius.circular(20),
|
| 280 |
+
topRight: const Radius.circular(20),
|
| 281 |
+
bottomLeft: Radius.circular(message.isUser ? 15 : 5),
|
| 282 |
+
bottomRight: Radius.circular(message.isUser ? 5 : 15),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
),
|
| 284 |
+
)
|
| 285 |
+
: null,
|
| 286 |
+
child: message.isLoading
|
| 287 |
+
? LoadingIndicator(
|
| 288 |
+
isCompleted: message.isStepCompleted ?? false,
|
| 289 |
+
)
|
| 290 |
+
: message.isPreFormatted
|
| 291 |
+
? SelectableLinkify(
|
| 292 |
+
text: message.text,
|
| 293 |
+
onOpen: _onOpen,
|
| 294 |
+
linkStyle: const TextStyle(
|
| 295 |
+
color: Colors.blueAccent,
|
| 296 |
+
decoration: TextDecoration.underline
|
| 297 |
+
),
|
| 298 |
+
|
| 299 |
+
style: const TextStyle(
|
| 300 |
+
fontFamily: 'Montserrat',
|
| 301 |
+
fontSize: 16,
|
| 302 |
+
color: Colors.white,
|
| 303 |
+
),
|
| 304 |
+
)
|
| 305 |
+
: Text(
|
| 306 |
+
message.text,
|
| 307 |
+
style: const TextStyle(color: Colors.white),
|
| 308 |
+
),
|
| 309 |
+
),
|
| 310 |
),
|
| 311 |
);
|
| 312 |
}
|