Browse Source

fix: add null safety check for controller.Scroll control might throw
assert when start up.

stalin 4 years ago
parent
commit
43e5414b7a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      lib/frontend/terminal_view.dart

+ 3 - 0
lib/frontend/terminal_view.dart

@@ -205,6 +205,9 @@ class _TerminalViewState extends State<TerminalView> {
               child: Scrollable(
                 controller: widget.scrollController,
                 viewportBuilder: (context, offset) {
+                  if (!widget.scrollController.hasClients) {
+                    return buildTerminal(context);
+                  }
                   final position = widget.scrollController.position;
 
                   /// use [_EmptyScrollActivity] to suppress unexpected behaviors