76 lines
2.4 KiB
Dart
76 lines
2.4 KiB
Dart
import 'package:t_basic_intl/intl.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'assistant_avatar.dart';
|
|
|
|
class ChatHeader extends StatelessWidget {
|
|
final VoidCallback? onClose;
|
|
const ChatHeader({super.key, this.onClose});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
children: [
|
|
SizedBox(
|
|
height: 120,
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const Padding(
|
|
padding: EdgeInsets.only(left: 6),
|
|
child: SizedBox(
|
|
child: AssistantAvatar(),
|
|
),
|
|
),
|
|
const SizedBox(width: 6),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(top: 48),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
Intl.getCurrentLocale().startsWith('zh')
|
|
? 'Hi, 我是众众!'
|
|
: 'Hi, I\'m Zhongzhong!',
|
|
style: TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
SizedBox(height: 12),
|
|
Text(
|
|
Intl.getCurrentLocale().startsWith('zh')
|
|
? '您的专属看、选、买、用车助手'
|
|
: 'Your exclusive assistant',
|
|
style: TextStyle(
|
|
fontSize: 11,
|
|
color: Colors.white70,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 6, right: 6),
|
|
child: IconButton(
|
|
icon: const Icon(
|
|
Icons.close,
|
|
color: Colors.white,
|
|
size: 24,
|
|
),
|
|
onPressed: onClose,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
height: 1,
|
|
color: Colors.white.withValues(alpha: 0.15),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
} |