reusableTextField function
Implementation
TextField reusableTextField(String text, IconData icon, bool isPasswordType, TextEditingController controler, String? errorText, Function(String) onChanged, bool submitted) {
return TextField(
controller: controler,
obscureText: isPasswordType,
enableSuggestions: !isPasswordType,
autocorrect: !isPasswordType,
cursorColor: Colors.black54,
onChanged: onChanged,
decoration: InputDecoration(
prefixIcon: Icon(icon,
color: Colors.black54
),
errorText: submitted ?errorText:null,
labelText: text,
labelStyle: TextStyle(color: Colors.black.withOpacity(0.9)),
filled: true,
floatingLabelBehavior: FloatingLabelBehavior.never,
fillColor: Colors.white.withOpacity(0.3),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20.0),
borderSide: const BorderSide(width: 0, style: BorderStyle.none)
)
),
keyboardType: isPasswordType ? TextInputType.visiblePassword : TextInputType
.emailAddress,
);
}