import 'package:baseproject/core/theme/custom_color.dart';
import 'package:baseproject/core/theme/text_style.dart';
import 'package:flutter/material.dart';

class FormTheme {
  static InputDecoration getInputDecoration({double radius = 6, Color? borderColor}) {
    return InputDecoration(
      border: OutlineInputBorder(
        borderSide: BorderSide(color: borderColor ?? CustomColor.textGray),
        borderRadius: BorderRadius.all(Radius.circular(radius)),
      ),
      enabledBorder: OutlineInputBorder(
        borderSide: BorderSide(color: borderColor ?? CustomColor.textGray),
        borderRadius: BorderRadius.all(Radius.circular(radius)),
      ),
      errorBorder: OutlineInputBorder(
        borderSide: const BorderSide(color: CustomColor.redText),
        borderRadius: BorderRadius.all(Radius.circular(radius)),
      ),
      focusedBorder: OutlineInputBorder(
        borderSide: BorderSide(color: borderColor ?? CustomColor.textGray),
        borderRadius: BorderRadius.all(Radius.circular(radius)),
      ),
      disabledBorder: OutlineInputBorder(
        borderSide: const BorderSide(color: CustomColor.textGray),
        borderRadius: BorderRadius.all(Radius.circular(radius)),
      ),
    );
  }

  static getDefaultInputDecorationTheme({double radius = 6}) => InputDecorationTheme(
        floatingLabelBehavior: FloatingLabelBehavior.never,
        prefixStyle: textStyleBodySmall.copyWith(color: CustomColor.textGray),
        prefixIconColor: CustomColor.textGray,
        focusColor: CustomColor.textGray,
        contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
        border: FormTheme.getInputDecoration(radius: radius).border,
        enabledBorder: FormTheme.getInputDecoration(radius: radius).enabledBorder,
        errorBorder: FormTheme.getInputDecoration(radius: radius).errorBorder,
        focusedBorder: FormTheme.getInputDecoration(radius: radius).focusedBorder,
        disabledBorder: FormTheme.getInputDecoration(radius: radius).disabledBorder,
        floatingLabelStyle: textStyleBodySmall.copyWith(color: CustomColor.textGray),
        hintStyle: textStyleBodySmall.copyWith(color: CustomColor.textGray),
      );

  static getSecondInputDecorationTheme({double radius = 6}) => InputDecorationTheme(
      floatingLabelBehavior: FloatingLabelBehavior.never,
      prefixStyle: textStyleBodySmall.copyWith(color: CustomColor.textGray),
      prefixIconColor: CustomColor.textGray,
      focusColor: CustomColor.textGray,
      contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
      border: FormTheme.getInputDecoration(radius: 6, borderColor: CustomColor.textGray).border,
      enabledBorder: FormTheme.getInputDecoration(radius: 6, borderColor: CustomColor.textGray).enabledBorder,
      errorBorder: FormTheme.getInputDecoration(radius: 6).errorBorder,
      focusedBorder: FormTheme.getInputDecoration(radius: 6).focusedBorder,
      disabledBorder: FormTheme.getInputDecoration(radius: 6).disabledBorder,
      floatingLabelStyle: textStyleBodySmall.copyWith(color: CustomColor.textGray),
      hintStyle: textStyleBodySmall.copyWith(color: CustomColor.textGray),
      fillColor: Colors.white);
}
