@@ -173,6 +173,7 @@ class CodeField extends StatefulWidget {
173173 final Color ? background;
174174 final EdgeInsets padding;
175175 final Decoration ? decoration;
176+ final TextDirection textDirection;
176177 final TextSelectionThemeData ? textSelectionTheme;
177178 final FocusNode ? focusNode;
178179
@@ -196,6 +197,7 @@ class CodeField extends StatefulWidget {
196197 this .smartQuotesType = SmartQuotesType .disabled,
197198 this .padding = EdgeInsets .zero,
198199 GutterStyle ? gutterStyle,
200+ this .textDirection = TextDirection .ltr,
199201 this .enabled,
200202 this .readOnly = false ,
201203 this .cursorColor,
@@ -434,6 +436,7 @@ class _CodeFieldState extends State<CodeField> {
434436 maxLines: widget.maxLines,
435437 expands: widget.expands,
436438 scrollController: _codeScroll,
439+ textDirection: widget.textDirection,
437440 decoration: const InputDecoration (
438441 isCollapsed: true ,
439442 contentPadding: EdgeInsets .symmetric (vertical: 16 ),
@@ -464,17 +467,19 @@ class _CodeFieldState extends State<CodeField> {
464467 return FocusableActionDetector (
465468 actions: widget.controller.actions,
466469 shortcuts: _shortcuts,
467- child: Container (
468- decoration: widget.decoration,
469- color: _backgroundCol,
470- key: _codeFieldKey,
471- padding: const EdgeInsets .only (left: 8 ),
472- child: Row (
473- crossAxisAlignment: CrossAxisAlignment .start,
474- children: [
475- if (widget.gutterStyle.showGutter) _buildGutter (),
476- Expanded (key: _editorKey, child: editingField),
477- ],
470+ child: Directionality (
471+ textDirection: widget.textDirection,
472+ child: Container (
473+ decoration: widget.decoration,
474+ color: _backgroundCol,
475+ key: _codeFieldKey,
476+ child: Row (
477+ crossAxisAlignment: CrossAxisAlignment .start,
478+ children: [
479+ if (widget.gutterStyle.showGutter) _buildGutter (),
480+ Expanded (key: _editorKey, child: editingField),
481+ ],
482+ ),
478483 ),
479484 ),
480485 );
0 commit comments