editorField method
Implementation
TextField editorField(
BuildContext context,
RegionPosition position,
) {
TextEditingController returnCorrectController(RegionPosition position) {
switch (position) {
case RegionPosition.before:
return beforeController;
case RegionPosition.inner:
return inController;
case RegionPosition.after:
return afterController;
}
}
return TextField(
smartQuotesType: SmartQuotesType.disabled,
smartDashesType: SmartDashesType.disabled,
enabled: widget.options.isEditable,
controller: returnCorrectController(position),
decoration: InputDecoration(
border: InputBorder.none,
filled: true,
fillColor: widget.options.regionOptions != null &&
position == RegionPosition.inner
? widget.options.regionOptions!.color
: widget.options.backgroundColor,
contentPadding: const EdgeInsets.only(
left: 10,
),
isDense: true,
),
maxLines: null,
style: TextStyle(
fontSize: getFontSize(context, fontSize: 18),
fontFamily: widget.options.fontFamily,
color: Colors.white.withValues(alpha: 0.87),
),
onChanged: (String event) {
if (widget.options.regionOptions != null &&
position != RegionPosition.after) {
handleRegionCaching(event, position);
}
handleTextChange(event, position, widget.options.regionOptions != null);
},
onTap: () {
handleCurrentFocusedTextfieldController(position);
},
inputFormatters: [
FilteringTextInputFormatter.deny(RegExp(r'[“”]'),
replacementString: '"'),
FilteringTextInputFormatter.deny(RegExp(r'[‘’]'),
replacementString: "'")
],
);
}