Initial commit: unionflow-mobile-apps
Application Flutter complète (sans build artifacts). Signed-off-by: lions dev Team
This commit is contained in:
43
lib/shared/widgets/dynamic_fab.dart
Normal file
43
lib/shared/widgets/dynamic_fab.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../design_system/tokens/app_colors.dart';
|
||||
import '../design_system/tokens/app_typography.dart';
|
||||
|
||||
/// UnionFlow Mobile - Composant DRY : DynamicFAB
|
||||
/// Bouton Flottant "Twitter Style" paramétrable pour les actions principales.
|
||||
class DynamicFAB extends StatelessWidget {
|
||||
final VoidCallback onPressed;
|
||||
final IconData icon;
|
||||
final String? label; // Si null, c'est juste un bouton rond. Si texte, c'est un "extended" FAB.
|
||||
|
||||
const DynamicFAB({
|
||||
Key? key,
|
||||
required this.onPressed,
|
||||
required this.icon,
|
||||
this.label,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (label != null) {
|
||||
return FloatingActionButton.extended(
|
||||
onPressed: onPressed,
|
||||
backgroundColor: AppColors.primaryGreen,
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 4,
|
||||
icon: Icon(icon, size: 20),
|
||||
label: Text(
|
||||
label!,
|
||||
style: AppTypography.actionText,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return FloatingActionButton(
|
||||
onPressed: onPressed,
|
||||
backgroundColor: AppColors.primaryGreen,
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 4,
|
||||
child: Icon(icon, size: 24),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user