Untitled

mail@pastecode.io avatar
unknown
dart
a year ago
1.5 kB
1
Indexable
Never
import 'package:centro/app/utilities/constants/app_colors.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class CentroTextField extends StatelessWidget {
  final TextEditingController controller;
  final String hintTxt;
  final bool isDescription;
  final int maxLines;
  final String? Function(String?)? validator;
  const CentroTextField(
      {super.key,
      required this.maxLines,
      this.hintTxt = '',
      this.isDescription = false,
      required this.controller, this.validator});

  @override
  Widget build(BuildContext context) {
    return TextFormField(
      validator: validator,
      
        controller: controller,
        maxLines: maxLines,
        style: const TextStyle(color: AppColors.primary, fontSize: 18),
        decoration: InputDecoration(
            focusedBorder: OutlineInputBorder(
                borderRadius: BorderRadius.circular(10),
                borderSide: BorderSide(
                    width: Get.width * 0.003, color: AppColors.lightGreen)),
            enabledBorder: OutlineInputBorder(
                borderRadius: BorderRadius.circular(10),
                borderSide: BorderSide(
                  width: Get.width * 0.003,
                  color: const Color.fromARGB(255, 158, 158, 158),
                )),
            hintText: hintTxt,
            hintStyle: const TextStyle(
                color: Color.fromARGB(255, 158, 158, 158), fontSize: 13)));
  }
}