Translate-Flutter/lib/widget/language_result_bar.dart
fengshengxiong 70d663706c 第一版
2024-07-12 11:26:44 +08:00

84 lines
2.3 KiB
Dart
Executable File

import 'package:flutter/material.dart';
import 'package:trans_lark/generated/assets.dart';
class LanguageResultBar extends StatelessWidget {
const LanguageResultBar({
super.key,
required this.fromLanguage,
required this.toLanguage,
});
final String fromLanguage;
final String toLanguage;
@override
Widget build(BuildContext context) {
return Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
const SizedBox(width: 8),
Flexible(
child: Text(
fromLanguage,
style: const TextStyle(
color: Color(0xff435561),
fontSize: 14,
fontWeight: FontWeight.w500,
overflow: TextOverflow.ellipsis,
),
),
),
],
),
),
),
const SizedBox(width: 20),
Container(
width: 26,
height: 18,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(9),
),
child: FittedBox(
fit: BoxFit.none,
child: Image.asset(
Assets.imagesSwitchHomeIcon,
width: 12,
height: 12,
),
),
),
const SizedBox(width: 20),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const SizedBox(width: 8),
Flexible(
child: Text(
toLanguage,
style: const TextStyle(
color: Color(0xff435561),
fontSize: 14,
fontWeight: FontWeight.w500,
overflow: TextOverflow.ellipsis,
),
),
),
],
),
),
),
],
);
}
}