You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RSGDoctorApp/lib/widgets/shared/text_fields/text_fields_utils.dart

58 lines
2.0 KiB
Dart

import 'package:flutter/material.dart';
class TextFieldsUtils {
static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor,
{double borderWidth = -1, double borderRadius = 12}) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: borderWidth == -1 ? 2.0 : borderWidth,
)),
);
}
static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown,
{IconData? suffixIcon, Color? dropDownColor}) {
return InputDecoration(
isDense: true,
contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
disabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
border: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
/*focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),*/
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: Icon(
suffixIcon ?? null,
color: Colors.grey.shade600,
),
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
}