Files
unionflow-mobile-apps/lib/presentation/widgets/shared/mini_header_bar.dart
dahoud 7cd7c6fc9e feat(shared): legacy presentation/ + shared design system + widgets
- lib/presentation : pages legacy (explore/network, notifications) avec BLoC
- lib/shared/design_system : UnionFlow Design System v2 (tokens, components)
  + MD3 tokens + module_colors par feature
- lib/shared/widgets : widgets transversaux (core_card, core_shimmer,
  error_widget, loading_widget, powered_by_lions_dev, etc.)
- lib/shared/constants + utils
2026-04-15 20:27:23 +00:00

64 lines
1.8 KiB
Dart

import 'package:flutter/material.dart';
import '../../../shared/design_system/tokens/app_colors.dart';
import '../../../shared/design_system/tokens/app_typography.dart';
import '../../../shared/widgets/mini_avatar.dart';
/// UnionFlow Mobile - Composant DRY : MiniHeaderBar
/// Remplace l'AppBar massive. Maximum 35-40px de hauteur.
class MiniHeaderBar extends StatelessWidget implements PreferredSizeWidget {
final String title;
final String? profileImageUrl;
final Widget? trailing;
const MiniHeaderBar({
Key? key,
required this.title,
this.profileImageUrl,
this.trailing,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final isDark = Theme.of(context).brightness == Brightness.dark;
return Container(
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 8, // Respecte la Status Bar
bottom: 8,
left: 16,
right: 16,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Bouton Menu/Profil à gauche
GestureDetector(
onTap: () {
Scaffold.of(context).openDrawer();
},
child: MiniAvatar(
imageUrl: profileImageUrl,
fallbackText: 'ME',
size: 28,
),
),
// Titre central (Petit)
Text(
title,
style: AppTypography.headerSmall.copyWith(
color: isDark ? AppColors.textPrimaryDark : AppColors.textPrimary,
),
),
if (trailing != null) trailing! else const SizedBox(width: 28),
],
),
);
}
@override
Size get preferredSize => const Size.fromHeight(40.0);
}