Procházet zdrojové kódy

feat: expose readOnly flag of CustomTextEdit in TerminalView

Georg Wechslberger před 3 roky
rodič
revize
1e03b7bfdb
1 změnil soubory, kde provedl 5 přidání a 0 odebrání
  1. 5 0
      lib/src/terminal_view.dart

+ 5 - 0
lib/src/terminal_view.dart

@@ -42,6 +42,7 @@ class TerminalView extends StatefulWidget {
     this.alwaysShowCursor = false,
     this.deleteDetection = false,
     this.shortcuts,
+    this.readOnly = false,
   }) : super(key: key);
 
   /// The underlying terminal that this widget renders.
@@ -115,6 +116,9 @@ class TerminalView extends StatefulWidget {
   /// of the terminal If not provided, [defaultTerminalShortcuts] will be used.
   final Map<ShortcutActivator, Intent>? shortcuts;
 
+  /// True if no input should send to the terminal.
+  final bool readOnly;
+
   @override
   State<TerminalView> createState() => TerminalViewState();
 }
@@ -219,6 +223,7 @@ class TerminalViewState extends State<TerminalView> {
         }
       },
       onKey: _onKeyEvent,
+      readOnly: widget.readOnly,
       child: child,
     );