dropDownWidgetWithLabel static method
dynamic
dropDownWidgetWithLabel(
- BuildContext context,
- String labelName,
- String hintText,
- dynamic value,
- List lstData,
- Function onChanged,
- Function onValidate, {
- double labelFontSize = 20,
- bool labelBold = true,
- double hintFontSize = 15,
- Color borderColor = Colors.redAccent,
- double borderRadius = 30,
- Color borderFocusColor = Colors.redAccent,
- double paddingLeft = 20,
- double paddingRight = 20,
- double paddingTop = 0,
- double paddingBottom = 0,
- String optionValue = "id",
- String optionLabel = "name",
- double contentPadding = 6,
- Color validationColor = Colors.redAccent,
- Color textColor = Colors.black,
- Color hintColor = Colors.black,
- double borderWidth = 2,
- double focusedBorderWidth = 2,
- double enabledBorderWidth = 1,
- Widget? suffixIcon,
- Icon? prefixIcon,
- bool showPrefixIcon = false,
- Color prefixIconColor = Colors.redAccent,
- double prefixIconPaddingLeft = 30,
- double prefixIconPaddingRight = 10,
- double prefixIconPaddingTop = 0,
- double prefixIconPaddingBottom = 0,
Implementation
static dropDownWidgetWithLabel(
BuildContext context,
String labelName,
String hintText,
dynamic value,
List<dynamic> lstData,
Function onChanged,
Function onValidate, {
double labelFontSize: 20,
bool labelBold = true,
double hintFontSize = 15,
Color borderColor = Colors.redAccent,
double borderRadius = 30,
Color borderFocusColor = Colors.redAccent,
double paddingLeft = 20,
double paddingRight = 20,
double paddingTop = 0,
double paddingBottom = 0,
String optionValue = "id",
String optionLabel = "name",
double contentPadding = 6,
Color validationColor = Colors.redAccent,
Color textColor = Colors.black,
Color hintColor = Colors.black,
double borderWidth = 2,
double focusedBorderWidth = 2,
double enabledBorderWidth = 1,
Widget? suffixIcon,
Icon? prefixIcon,
bool showPrefixIcon = false,
Color prefixIconColor = Colors.redAccent,
double prefixIconPaddingLeft = 30,
double prefixIconPaddingRight = 10,
double prefixIconPaddingTop = 0,
double prefixIconPaddingBottom = 0,
}) {
return Container(
padding: EdgeInsets.only(left: 10, right: 10),
child: Column(
children: <Widget>[
new Padding(
padding: EdgeInsets.only(
left: 0,
right: 10,
top: 10,
bottom: 10,
),
child: Align(
alignment: Alignment.topLeft,
child: Text(
labelName,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: labelFontSize,
fontWeight: labelBold ? FontWeight.bold : null,
),
),
),
),
dropDownWidget(
context,
hintText,
value,
lstData,
onChanged,
onValidate,
hintFontSize: hintFontSize,
borderColor: borderColor,
borderRadius: borderRadius,
borderFocusColor: borderFocusColor,
paddingLeft: paddingLeft,
paddingRight: paddingRight,
paddingTop: paddingTop,
paddingBottom: paddingBottom,
optionValue: optionValue,
optionLabel: optionLabel,
contentPadding: contentPadding,
validationColor: validationColor,
textColor: textColor,
hintColor: hintColor,
borderWidth: borderWidth,
focusedBorderWidth: focusedBorderWidth,
enabledBorderWidth: enabledBorderWidth,
suffixIcon: suffixIcon,
prefixIcon: prefixIcon,
showPrefixIcon: showPrefixIcon,
prefixIconColor: prefixIconColor,
prefixIconPaddingLeft: prefixIconPaddingLeft,
prefixIconPaddingRight: prefixIconPaddingRight,
prefixIconPaddingTop: prefixIconPaddingTop,
prefixIconPaddingBottom: prefixIconPaddingBottom,
)
],
),
);
}