Skip to content

Commit ea26ed0

Browse files
authored
Expose smartDashesType and smartQuotesType on the underlying TextField, and disable them by default.
Expose `smartDashesType` and `smartQuotesType` on the underlying `TextField`, and disable them by default. This fixes an issue where typing a " on the iOS keyboard would automatically be replaced by a “.
1 parent 0978660 commit ea26ed0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/src/code_field/code_field.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ class CodeField extends StatefulWidget {
145145
/// {@macro flutter.widgets.textField.textStyle}
146146
final TextStyle? textStyle;
147147

148+
/// {@macro flutter.widgets.textField.smartDashesType}
149+
final SmartDashesType smartDashesType;
150+
151+
/// {@macro flutter.widgets.textField.smartQuotesType}
152+
final SmartQuotesType smartQuotesType;
153+
148154
/// A way to replace specific line numbers by a custom TextSpan
149155
final TextSpan Function(int, TextStyle?)? lineNumberBuilder;
150156

@@ -181,6 +187,8 @@ class CodeField extends StatefulWidget {
181187
this.background,
182188
this.decoration,
183189
this.textStyle,
190+
this.smartDashesType = SmartDashesType.disabled,
191+
this.smartQuotesType = SmartQuotesType.disabled,
184192
this.padding = EdgeInsets.zero,
185193
GutterStyle? gutterStyle,
186194
this.enabled,
@@ -406,6 +414,8 @@ class _CodeFieldState extends State<CodeField> {
406414
focusNode: _focusNode,
407415
scrollPadding: widget.padding,
408416
style: textStyle,
417+
smartDashesType: widget.smartDashesType,
418+
smartQuotesType: widget.smartQuotesType,
409419
controller: widget.controller,
410420
minLines: widget.minLines,
411421
maxLines: widget.maxLines,

0 commit comments

Comments
 (0)