textFormDecoration function

InputDecoration textFormDecoration(
  1. String title,
  2. String hint,
  3. IconData icon,
  4. BuildContext context
)

Returns the input decoration for a text form field.

This function creates and returns an InputDecoration object with the specified title, hint, icon, and context.

Implementation

InputDecoration textFormDecoration(
  String title,
  String hint,
  IconData icon,
  BuildContext context,
) {
  return InputDecoration(
    labelText: title,
    hintText: hint,
    border: OutlineInputBorder(
      borderRadius: BorderRadius.circular(100),
    ),
    prefixIcon: Icon(icon),
    focusedBorder: OutlineInputBorder(
      borderRadius: BorderRadius.circular(16),
      borderSide: BorderSide(
        color: Theme.of(context).colorScheme.primaryContainer,
        width: 4,
      ),
    ),
  );
}