Files
social-app/apps/lib/shared/widgets/app_input.dart
T

52 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import '../../core/theme/design_tokens.dart';
class AppInput extends StatelessWidget {
final String label;
final String hint;
final TextEditingController? controller;
final bool obscureText;
final TextInputType? keyboardType;
final Widget? suffix;
final int? maxLines;
final bool enabled;
const AppInput({
super.key,
required this.label,
required this.hint,
this.controller,
this.obscureText = false,
this.keyboardType,
this.suffix,
this.maxLines = 1,
this.enabled = true,
});
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
label,
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
color: AppColors.slate600,
),
),
const SizedBox(height: 6),
TextField(
controller: controller,
obscureText: obscureText,
keyboardType: keyboardType,
maxLines: maxLines,
enabled: enabled,
decoration: InputDecoration(hintText: hint, suffixIcon: suffix),
),
],
);
}
}