Field.url constructor
Field.url(
- String key, {
- String? label,
- String? value,
- FormValidator? validator,
- bool autofocus = false,
- String? dummyData,
- Widget? header,
- TextStyle? titleStyle,
- bool? readOnly,
- dynamic onChanged(
- dynamic value
- FieldStyleTextField? style,
Field.url is a constructor that helps in managing url fields
Implementation
Field.url(
this.key, {
this.label,
String? value,
this.validator,
this.autofocus = false,
this.dummyData,
this.header,
this.footer,
this.titleStyle,
this.hidden = false,
this.readOnly,
Function(dynamic value)? onChanged,
FieldStyleTextField? style,
}) : _value = value,
this.style = style ?? FieldStyleTextField() {
this.style = (this.style as FieldStyleTextField).copyWith(
type: "url",
keyboardType: TextInputType.url,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(
r'[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)',
),
),
],
);
setOnChanged(onChanged);
widget = NyFormTextField.fromField(this);
}