74 lines
1.7 KiB
Dart
74 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
|
import '../../../core/theme/app_theme.dart';
|
|
import '../../../core/theme/app_spacing.dart';
|
|
|
|
/// 首頁頂欄 - Logo + 搜索/通知/頭像
|
|
class HeaderBar extends StatelessWidget {
|
|
const HeaderBar({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final colorScheme = Theme.of(context).colorScheme;
|
|
|
|
return Padding(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: AppSpacing.md,
|
|
vertical: AppSpacing.sm,
|
|
),
|
|
child: Row(
|
|
children: [
|
|
// Logo
|
|
Text(
|
|
'MONISUO',
|
|
style: AppTextStyles.headlineLarge(context).copyWith(
|
|
fontSize: 18,
|
|
letterSpacing: 1,
|
|
),
|
|
),
|
|
const Spacer(),
|
|
// Customer service button
|
|
_IconButton(
|
|
icon: LucideIcons.headset,
|
|
colorScheme: colorScheme,
|
|
onTap: () {},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _IconButton extends StatelessWidget {
|
|
const _IconButton({
|
|
required this.icon,
|
|
required this.colorScheme,
|
|
required this.onTap,
|
|
});
|
|
|
|
final IconData icon;
|
|
final ColorScheme colorScheme;
|
|
final VoidCallback onTap;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: onTap,
|
|
child: Container(
|
|
width: 32,
|
|
height: 32,
|
|
decoration: BoxDecoration(
|
|
color: colorScheme.surfaceContainerHigh,
|
|
borderRadius: BorderRadius.circular(AppRadius.xl),
|
|
),
|
|
alignment: Alignment.center,
|
|
child: Icon(
|
|
icon,
|
|
size: 16,
|
|
color: colorScheme.onSurfaceVariant,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|