import 'package:farm_tpf/utils/const_color.dart';
import 'package:flutter/material.dart';

class TextFieldAreaWidget extends StatelessWidget {
  final String hint;
  final String labelText;
  final TextEditingController controller;
  final Function(String?) onSaved;
  final String? Function(String?)? validator;
  TextFieldAreaWidget({required this.hint, required this.labelText, required this.onSaved, this.validator, required this.controller});
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(8),
      decoration: BoxDecoration(color: AppColors.YELLOW.withOpacity(0.1), borderRadius: BorderRadius.circular(8)),
      child: TextFormField(
        keyboardType: TextInputType.text,
        controller: controller,
        decoration: InputDecoration(labelText: labelText, hintText: hint, border: InputBorder.none),
        onSaved: onSaved,
        validator: validator,
      ),
    );
  }
}
