From c9f7d31e81ef3ab62f53d70ba2599dc6b298d32e Mon Sep 17 00:00:00 2001 From: Ryan G <78384369+SpongeManiac@users.noreply.github.com> Date: Sun, 13 Jul 2025 10:40:58 -0600 Subject: [PATCH] Add UndoHistoryController --- lib/src/code_field/code_field.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/code_field/code_field.dart b/lib/src/code_field/code_field.dart index ab2a38fc..d0f2022a 100644 --- a/lib/src/code_field/code_field.dart +++ b/lib/src/code_field/code_field.dart @@ -136,6 +136,10 @@ class CodeField extends StatefulWidget { /// language highlight, themeing and modifiers. final CodeController controller; + /// An UndoHistoryController instance + /// to control TextField history. + final UndoHistoryController? undoController; + @Deprecated('Use gutterStyle instead') final GutterStyle lineNumberStyle; @@ -180,6 +184,7 @@ class CodeField extends StatefulWidget { const CodeField({ super.key, required this.controller, + this.undoController, this.minLines, this.maxLines, this.expands = false, @@ -417,6 +422,7 @@ class _CodeFieldState extends State { smartDashesType: widget.smartDashesType, smartQuotesType: widget.smartQuotesType, controller: widget.controller, + undoController: widget.undoController, minLines: widget.minLines, maxLines: widget.maxLines, expands: widget.expands,