Преглед изворни кода

fix null safety probleam to satisfied flutter 2.6

stalin пре 4 година
родитељ
комит
e7c825be00

+ 6 - 9
example/lib/isolate.dart

@@ -31,11 +31,9 @@ class MyHomePage extends StatefulWidget {
 }
 
 class FakeTerminalBackend extends TerminalBackend {
-  Completer<int> _exitCodeCompleter;
+  Completer<int> _exitCodeCompleter = Completer<int>();
   // ignore: close_sinks
-  StreamController<String> _outStream;
-
-  FakeTerminalBackend();
+  StreamController<String> _outStream = StreamController<String>();
 
   @override
   Future<int> get exitCode => _exitCodeCompleter.future;
@@ -90,15 +88,14 @@ class FakeTerminalBackend extends TerminalBackend {
 }
 
 class _MyHomePageState extends State<MyHomePage> {
-  TerminalIsolate terminal;
+  TerminalIsolate terminal = TerminalIsolate(
+    backend: FakeTerminalBackend(),
+    maxLines: 10000,
+  );
 
   @override
   void initState() {
     super.initState();
-    terminal = TerminalIsolate(
-      backend: FakeTerminalBackend(),
-      maxLines: 10000,
-    );
     terminal.start();
   }
 

+ 7 - 10
example/lib/main.dart

@@ -30,19 +30,17 @@ class MyHomePage extends StatefulWidget {
 }
 
 class FakeTerminalBackend extends TerminalBackend {
-  Completer<int> _exitCodeCompleter;
+  Completer<int> _exitCodeCompleter = Completer<int>();
   // ignore: close_sinks
-  StreamController<String> _outStream;
+  StreamController<String> _outStream = StreamController<String>();
+
 
-  FakeTerminalBackend();
 
   @override
   Future<int> get exitCode => _exitCodeCompleter.future;
 
   @override
   void init() {
-    _exitCodeCompleter = Completer<int>();
-    _outStream = StreamController<String>();
     _outStream.sink.add('xterm.dart demo');
     _outStream.sink.add('\r\n');
     _outStream.sink.add('\$ ');
@@ -89,15 +87,14 @@ class FakeTerminalBackend extends TerminalBackend {
 }
 
 class _MyHomePageState extends State<MyHomePage> {
-  Terminal terminal;
+  Terminal terminal = Terminal(
+    backend: FakeTerminalBackend(),
+    maxLines: 10000,
+  );
 
   @override
   void initState() {
     super.initState();
-    terminal = Terminal(
-      backend: FakeTerminalBackend(),
-      maxLines: 10000,
-    );
   }
 
   void onInput(String input) {}

+ 1 - 1
example/pubspec.lock

@@ -28,7 +28,7 @@ packages:
       name: characters
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.1.0"
+    version: "1.2.0"
   charcode:
     dependency: transitive
     description:

+ 2 - 0
example/windows/flutter/generated_plugin_registrant.cc

@@ -2,6 +2,8 @@
 //  Generated file. Do not edit.
 //
 
+// clang-format off
+
 #include "generated_plugin_registrant.h"
 
 

+ 2 - 0
example/windows/flutter/generated_plugin_registrant.h

@@ -2,6 +2,8 @@
 //  Generated file. Do not edit.
 //
 
+// clang-format off
+
 #ifndef GENERATED_PLUGIN_REGISTRANT_
 #define GENERATED_PLUGIN_REGISTRANT_
 

+ 47 - 1
pubspec.lock

@@ -22,6 +22,13 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "2.2.0"
+  asn1lib:
+    dependency: transitive
+    description:
+      name: asn1lib
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.5.15"
   async:
     dependency: transitive
     description:
@@ -98,7 +105,7 @@ packages:
       name: characters
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.1.0"
+    version: "1.2.0"
   charcode:
     dependency: transitive
     description:
@@ -162,6 +169,15 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "2.0.3"
+  dartssh:
+    dependency: "direct dev"
+    description:
+      path: "."
+      ref: test
+      resolved-ref: "3113e72b9e1b4ac742147be1ad34a586e9cc9bb5"
+      url: "https://github.com/linhanyu/dartssh"
+    source: git
+    version: "1.0.4+4"
   equatable:
     dependency: "direct main"
     description:
@@ -221,6 +237,13 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "2.0.0"
+  http:
+    dependency: transitive
+    description:
+      name: http
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.13.3"
   http_multi_server:
     dependency: transitive
     description:
@@ -319,6 +342,13 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "3.0.0-nullsafety.1"
+  pointycastle:
+    dependency: transitive
+    description:
+      name: pointycastle
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "1.0.2"
   pool:
     dependency: transitive
     description:
@@ -429,6 +459,15 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "1.0.0"
+  tweetnacl:
+    dependency: transitive
+    description:
+      path: "."
+      ref: HEAD
+      resolved-ref: "68bba352d1972bb72643760b9f97cf44cb75a88d"
+      url: "https://github.com/linhanyu/tweetnacl-dart"
+    source: git
+    version: "0.3.2"
   typed_data:
     dependency: transitive
     description:
@@ -436,6 +475,13 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "1.3.0"
+  validators:
+    dependency: transitive
+    description:
+      name: validators
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "2.0.0+1"
   vector_math:
     dependency: transitive
     description:

+ 2 - 0
pubspec.yaml

@@ -22,6 +22,8 @@ dev_dependencies:
   mockito: ^5.0.15
   build_runner: ^2.1.1
 
+
+
 # For information on the generic Dart part of this file, see the
 # following page: https://dart.dev/tools/pub/pubspec