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,78 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:barber_app/core/theme/app_theme.dart';
class CustomTextField extends StatelessWidget {
final TextEditingController controller;
final String label;
final String? hint;
final IconData? prefixIcon;
final Widget? suffixIcon;
final bool obscureText;
final TextInputType? keyboardType;
final String? Function(String?)? validator;
final int maxLines;
final void Function(String)? onChanged;
final TextCapitalization textCapitalization;
final List<TextInputFormatter>? inputFormatters;
const CustomTextField({
super.key,
required this.controller,
required this.label,
this.hint,
this.prefixIcon,
this.suffixIcon,
this.obscureText = false,
this.keyboardType,
this.validator,
this.maxLines = 1,
this.onChanged,
this.textCapitalization = TextCapitalization.none,
this.inputFormatters,
});
@override
Widget build(BuildContext context) {
final isDark = Theme.of(context).brightness == Brightness.dark;
final textColor = isDark ? AppColors.textPrimary : Colors.black87;
final labelColor = isDark ? AppColors.textSecondary : Colors.black54;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
label,
style: TextStyle(
color: labelColor,
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 8),
TextFormField(
controller: controller,
obscureText: obscureText,
keyboardType: keyboardType,
validator: validator,
maxLines: maxLines,
onChanged: onChanged,
textCapitalization: textCapitalization,
inputFormatters: inputFormatters,
style: TextStyle(
color: textColor,
fontSize: 16,
),
decoration: InputDecoration(
hintText: hint,
prefixIcon: prefixIcon != null
? Icon(prefixIcon, color: labelColor)
: null,
suffixIcon: suffixIcon,
hintStyle: TextStyle(color: isDark ? Colors.white38 : Colors.black38),
),
),
],
);
}
}