Initial commit - app-padrao-1.0

This commit is contained in:
Erik Silva
2025-12-19 23:29:24 -03:00
commit ec76d3d633
205 changed files with 13131 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
import 'package:flutter/material.dart';
import 'package:barber_app/core/theme/app_theme.dart';
class LoadingButton extends StatelessWidget {
final String text;
final bool isLoading;
final VoidCallback onPressed;
final Color? backgroundColor;
final Color? textColor;
final IconData? icon;
const LoadingButton({
super.key,
required this.text,
required this.isLoading,
required this.onPressed,
this.backgroundColor,
this.textColor,
this.icon,
});
@override
Widget build(BuildContext context) {
return AnimatedContainer(
duration: const Duration(milliseconds: 200),
height: 56,
child: ElevatedButton(
onPressed: isLoading ? null : onPressed,
style: ElevatedButton.styleFrom(
backgroundColor: backgroundColor ?? AppColors.primaryColor,
foregroundColor: textColor ?? AppColors.background,
disabledBackgroundColor: AppColors.primaryColor.withValues(
alpha: 0.5,
),
),
child: isLoading
? SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(
strokeWidth: 2.5,
valueColor: AlwaysStoppedAnimation<Color>(
textColor ?? AppColors.background,
),
),
)
: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (icon != null) ...[
Icon(icon, size: 20),
const SizedBox(width: 8),
],
Text(
text,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
],
),
),
);
}
}