Skip to content

Commit 2cec6eb

Browse files
authored
Add UndoHistoryController (#302)
1 parent 37e1e5e commit 2cec6eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/src/code_field/code_field.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ class CodeField extends StatefulWidget {
136136
/// language highlight, themeing and modifiers.
137137
final CodeController controller;
138138

139+
/// An UndoHistoryController instance
140+
/// to control TextField history.
141+
final UndoHistoryController? undoController;
142+
139143
@Deprecated('Use gutterStyle instead')
140144
final GutterStyle lineNumberStyle;
141145

@@ -180,6 +184,7 @@ class CodeField extends StatefulWidget {
180184
const CodeField({
181185
super.key,
182186
required this.controller,
187+
this.undoController,
183188
this.minLines,
184189
this.maxLines,
185190
this.expands = false,
@@ -417,6 +422,7 @@ class _CodeFieldState extends State<CodeField> {
417422
smartDashesType: widget.smartDashesType,
418423
smartQuotesType: widget.smartQuotesType,
419424
controller: widget.controller,
425+
undoController: widget.undoController,
420426
minLines: widget.minLines,
421427
maxLines: widget.maxLines,
422428
expands: widget.expands,

0 commit comments

Comments
 (0)