iosTextField function
iOS Text Field
Implementation
CupertinoTextField iosTextField(
String? hint,
String? label,
Color? hintColor,
double? padding,
Color? bgColor,
Color? labelColor,
Color? borderColor,
Color? focusBorderColor,
bool? obscureText,
Function onChanged,
Widget? suffix,
Widget? prefix,
TextInputType? keyboardType,
TextEditingController? controller,
) {
return CupertinoTextField(
placeholder: hint,
placeholderStyle: TextStyle(
color: hintColor ?? Colors.black,
),
padding: EdgeInsets.all(padding ?? 16.0),
obscureText: obscureText ?? false,
decoration: BoxDecoration(
color: bgColor ?? Colors.white,
border: Border.all(color: borderColor ?? Colors.black26),
borderRadius: BorderRadius.all(Radius.circular(4.0)),
),
controller: controller,
onChanged: onChanged as void Function(String),
keyboardType: keyboardType,
suffix: Padding(
padding: EdgeInsets.only(right: padding ?? 16.0),
child: suffix,
),
);
}