iosTextField function

CupertinoTextField iosTextField(
  1. String? hint,
  2. String? label,
  3. Color? hintColor,
  4. double? padding,
  5. Color? bgColor,
  6. Color? labelColor,
  7. Color? borderColor,
  8. Color? focusBorderColor,
  9. bool? obscureText,
  10. Function onChanged,
  11. Widget? suffix,
  12. Widget? prefix,
  13. TextInputType? keyboardType,
  14. TextEditingController? controller,
)

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,
    ),
  );
}