content: import 'package:flutter/material.dart';
  import 'package:flutterfire_samples/res/custom_colors.dart';
  
  class CustomFormField extends StatelessWidget {
    const CustomFormField({
      Key? key,
      required TextEditingController controller,
      required FocusNode focusNode,
      required TextInputType keyboardType,
      required TextInputAction inputAction,
      required String label,
      required String hint,
      required Function(String value) validator,
      this.isObscure = false,
      this.isCapitalized = false,
      this.maxLines = 1,
      this.isLabelEnabled = true,
    })  : _emailController = controller,
          _emailFocusNode = focusNode,
          _keyboardtype = keyboardType,
          _inputAction = inputAction,
          _label = label,
          _hint = hint,
          _validator = validator,
          super(key: key);
  
    final TextEditingController _emailController;
    final FocusNode _emailFocusNode;
    final TextInputType _keyboardtype;
    final TextInputAction _inputAction;
    final String _label;
    final String _hint;
    final bool isObscure;
    final bool isCapitalized;
    final int maxLines;
    final bool isLabelEnabled;
    final Function(String) _validator;
  
    @override
    Widget build(BuildContext context) {
      return TextFormField(
        maxLines: maxLines,
        controller: _emailController,
        focusNode: _emailFocusNode,
        keyboardType: _keyboardtype,
        obscureText: isObscure,
        textCapitalization:
            isCapitalized ? TextCapitalization.words : TextCapitalization.none,
        textInputAction: _inputAction,
        cursorColor: Palette.firebaseYellow,
        validator: (value) => _validator(value!),
        decoration: InputDecoration(
          labelText: isLabelEnabled ? _label : null,
          labelStyle: TextStyle(color: Palette.firebaseYellow),
          hintText: _hint,
          hintStyle: TextStyle(
            color: Palette.firebaseGrey.withOpacity(0.5),
          ),
          errorStyle: const TextStyle(
            color: Colors.redAccent,
            fontWeight: FontWeight.bold,
          ),
          focusedBorder: OutlineInputBorder(
            borderRadius: BorderRadius.circular(8.0),
            borderSide: BorderSide(
              color: Palette.firebaseAmber,
              width: 2,
            ),
          ),
          enabledBorder: OutlineInputBorder(
            borderRadius: BorderRadius.circular(8.0),
            borderSide: BorderSide(
              color: Palette.firebaseGrey.withOpacity(0.5),
            ),
          ),
          errorBorder: OutlineInputBorder(
            borderRadius: BorderRadius.circular(8.0),
            borderSide: const BorderSide(
              color: Colors.redAccent,
              width: 2,
            ),
          ),
          focusedErrorBorder: OutlineInputBorder(
            borderRadius: BorderRadius.circular(8.0),
            borderSide: const BorderSide(
              color: Colors.redAccent,
              width: 2,
            ),
          ),
        ),
      );
    }
  }
  