Explorar o código

Implements review remarks

devmil %!s(int64=4) %!d(string=hai) anos
pai
achega
738694a9d1
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      example/lib/main.dart

+ 5 - 1
example/lib/main.dart

@@ -43,6 +43,11 @@ class _MyHomePageState extends State<MyHomePage> {
   }
 
   void onInput(String input) {
+    // in a "real" terminal emulation you would connect onInput to the backend
+    // (like a pty or ssh connection) that then handles the changes in the
+    // terminal.
+    // As we don't have a connected backend here we simulate the changes by
+    // directly writing to the terminal.
     if (input == '\r') {
       terminal.write('\r\n');
       terminal.write('\$ ');
@@ -50,7 +55,6 @@ class _MyHomePageState extends State<MyHomePage> {
       terminal.buffer.eraseCharacters(1);
       terminal.buffer.backspace();
       terminal.refresh();
-      return;
     } else {
       terminal.write(input);
     }