Parcourir la source

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

stalin il y a 4 ans
Parent
commit
43e5414b7a
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  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