Skip to content

Commit e7c825b

Browse files
author
stalin
committed
fix null safety probleam to satisfied flutter 2.6
1 parent 9f4e312 commit e7c825b

File tree

7 files changed

+67
-21
lines changed

7 files changed

+67
-21
lines changed

example/lib/isolate.dart

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ class MyHomePage extends StatefulWidget {
3131
}
3232

3333
class FakeTerminalBackend extends TerminalBackend {
34-
Completer<int> _exitCodeCompleter;
34+
Completer<int> _exitCodeCompleter = Completer<int>();
3535
// ignore: close_sinks
36-
StreamController<String> _outStream;
37-
38-
FakeTerminalBackend();
36+
StreamController<String> _outStream = StreamController<String>();
3937

4038
@override
4139
Future<int> get exitCode => _exitCodeCompleter.future;
@@ -90,15 +88,14 @@ class FakeTerminalBackend extends TerminalBackend {
9088
}
9189

9290
class _MyHomePageState extends State<MyHomePage> {
93-
TerminalIsolate terminal;
91+
TerminalIsolate terminal = TerminalIsolate(
92+
backend: FakeTerminalBackend(),
93+
maxLines: 10000,
94+
);
9495

9596
@override
9697
void initState() {
9798
super.initState();
98-
terminal = TerminalIsolate(
99-
backend: FakeTerminalBackend(),
100-
maxLines: 10000,
101-
);
10299
terminal.start();
103100
}
104101

example/lib/main.dart

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,17 @@ class MyHomePage extends StatefulWidget {
3030
}
3131

3232
class FakeTerminalBackend extends TerminalBackend {
33-
Completer<int> _exitCodeCompleter;
33+
Completer<int> _exitCodeCompleter = Completer<int>();
3434
// ignore: close_sinks
35-
StreamController<String> _outStream;
35+
StreamController<String> _outStream = StreamController<String>();
36+
3637

37-
FakeTerminalBackend();
3838

3939
@override
4040
Future<int> get exitCode => _exitCodeCompleter.future;
4141

4242
@override
4343
void init() {
44-
_exitCodeCompleter = Completer<int>();
45-
_outStream = StreamController<String>();
4644
_outStream.sink.add('xterm.dart demo');
4745
_outStream.sink.add('\r\n');
4846
_outStream.sink.add('\$ ');
@@ -89,15 +87,14 @@ class FakeTerminalBackend extends TerminalBackend {
8987
}
9088

9189
class _MyHomePageState extends State<MyHomePage> {
92-
Terminal terminal;
90+
Terminal terminal = Terminal(
91+
backend: FakeTerminalBackend(),
92+
maxLines: 10000,
93+
);
9394

9495
@override
9596
void initState() {
9697
super.initState();
97-
terminal = Terminal(
98-
backend: FakeTerminalBackend(),
99-
maxLines: 10000,
100-
);
10198
}
10299

103100
void onInput(String input) {}

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ packages:
2828
name: characters
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.1.0"
31+
version: "1.2.0"
3232
charcode:
3333
dependency: transitive
3434
description:

example/windows/flutter/generated_plugin_registrant.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Generated file. Do not edit.
33
//
44

5+
// clang-format off
6+
57
#include "generated_plugin_registrant.h"
68

79

example/windows/flutter/generated_plugin_registrant.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Generated file. Do not edit.
33
//
44

5+
// clang-format off
6+
57
#ifndef GENERATED_PLUGIN_REGISTRANT_
68
#define GENERATED_PLUGIN_REGISTRANT_
79

pubspec.lock

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ packages:
2222
url: "https://pub.dartlang.org"
2323
source: hosted
2424
version: "2.2.0"
25+
asn1lib:
26+
dependency: transitive
27+
description:
28+
name: asn1lib
29+
url: "https://pub.dartlang.org"
30+
source: hosted
31+
version: "0.5.15"
2532
async:
2633
dependency: transitive
2734
description:
@@ -98,7 +105,7 @@ packages:
98105
name: characters
99106
url: "https://pub.dartlang.org"
100107
source: hosted
101-
version: "1.1.0"
108+
version: "1.2.0"
102109
charcode:
103110
dependency: transitive
104111
description:
@@ -162,6 +169,15 @@ packages:
162169
url: "https://pub.dartlang.org"
163170
source: hosted
164171
version: "2.0.3"
172+
dartssh:
173+
dependency: "direct dev"
174+
description:
175+
path: "."
176+
ref: test
177+
resolved-ref: "3113e72b9e1b4ac742147be1ad34a586e9cc9bb5"
178+
url: "https://github.com/linhanyu/dartssh"
179+
source: git
180+
version: "1.0.4+4"
165181
equatable:
166182
dependency: "direct main"
167183
description:
@@ -221,6 +237,13 @@ packages:
221237
url: "https://pub.dartlang.org"
222238
source: hosted
223239
version: "2.0.0"
240+
http:
241+
dependency: transitive
242+
description:
243+
name: http
244+
url: "https://pub.dartlang.org"
245+
source: hosted
246+
version: "0.13.3"
224247
http_multi_server:
225248
dependency: transitive
226249
description:
@@ -319,6 +342,13 @@ packages:
319342
url: "https://pub.dartlang.org"
320343
source: hosted
321344
version: "3.0.0-nullsafety.1"
345+
pointycastle:
346+
dependency: transitive
347+
description:
348+
name: pointycastle
349+
url: "https://pub.dartlang.org"
350+
source: hosted
351+
version: "1.0.2"
322352
pool:
323353
dependency: transitive
324354
description:
@@ -429,13 +459,29 @@ packages:
429459
url: "https://pub.dartlang.org"
430460
source: hosted
431461
version: "1.0.0"
462+
tweetnacl:
463+
dependency: transitive
464+
description:
465+
path: "."
466+
ref: HEAD
467+
resolved-ref: "68bba352d1972bb72643760b9f97cf44cb75a88d"
468+
url: "https://github.com/linhanyu/tweetnacl-dart"
469+
source: git
470+
version: "0.3.2"
432471
typed_data:
433472
dependency: transitive
434473
description:
435474
name: typed_data
436475
url: "https://pub.dartlang.org"
437476
source: hosted
438477
version: "1.3.0"
478+
validators:
479+
dependency: transitive
480+
description:
481+
name: validators
482+
url: "https://pub.dartlang.org"
483+
source: hosted
484+
version: "2.0.0+1"
439485
vector_math:
440486
dependency: transitive
441487
description:

pubspec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ dev_dependencies:
2222
mockito: ^5.0.15
2323
build_runner: ^2.1.1
2424

25+
26+
2527
# For information on the generic Dart part of this file, see the
2628
# following page: https://dart.dev/tools/pub/pubspec
2729

0 commit comments

Comments
 (0)