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.

82 lines
2.3 KiB

import 'package:flutter/material.dart';
import '../models/translation_message_model.dart';
class TranslationMessageItem extends StatelessWidget {
final TranslationMessage message;
const TranslationMessageItem({
Key? key,
required this.message,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(vertical: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Original text
Container(
width: double.infinity,
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: const Color(0xFFF5F5F5),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: Colors.grey[300]!,
width: 0.5,
),
),
child: Text(
message.original,
style: TextStyle(
color: Colors.grey[800],
fontSize: 14,
height: 1.5,
),
),
),
const SizedBox(height: 8),
// Translated text
Container(
width: double.infinity,
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: const Color(0xFFEEF4FF),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: const Color(0xFFD0DFFF),
width: 0.5,
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
message.translated,
style: TextStyle(
color: Colors.black87,
fontSize: 14,
fontWeight: FontWeight.w500,
height: 1.5,
),
),
),
const SizedBox(width: 8),
Icon(
Icons.volume_up,
color: Colors.grey[600],
size: 20,
),
],
),
),
],
),
);
}
}