buildColumnWithTextField function

Widget buildColumnWithTextField(
  1. String label,
  2. TextEditingController controller,
  3. String hintText,
  4. bool isRequired, {
  5. bool isNumber = false,
})

Implementation

Widget buildColumnWithTextField(
  String label,
  TextEditingController controller,
  String hintText,
  bool isRequired, {
  bool isNumber = false,
}) {
  return Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      _buildLabel(label, isRequired),
      const SizedBox(height: 6),
      Container(
        decoration: BoxDecoration(
          gradient: const LinearGradient(
            colors: [Color(0xFF2A2D2F), Color(0xFF1F2123)],
            begin: Alignment.topLeft,
            end: Alignment.bottomRight,
          ),
          borderRadius: BorderRadius.circular(8),
          boxShadow: [
            BoxShadow(
              color: Colors.black.withOpacity(0.2),
              blurRadius: 4,
              offset: const Offset(0, 2),
            ),
          ],
        ),
        child: TextFormField(
          controller: controller,
          style: const TextStyle(color: Colors.white),
          keyboardType: isNumber ? TextInputType.number : TextInputType.text,
          decoration: _inputDecoration(hintText),
          validator:
              isRequired
                  ? (value) =>
                      (value == null || value.isEmpty)
                          ? "$label is required"
                          : null
                  : null,
        ),
      ),
    ],
  );
}