modal_bottom_sheet icon indicating copy to clipboard operation
modal_bottom_sheet copied to clipboard

Unhandled Exception: 'package:flutter/src/widgets/scroll_controller.dart': Failed assertion: line 201 pos 12: '_positions.isNotEmpty': ScrollController not attached to any scroll views.

Open HaelArena opened this issue 10 months ago • 4 comments

GestureDetector( onLongPressUp: () { showCupertinoModalBottomSheet( isDismissible: true, backgroundColor: lightBlackNavBar, useRootNavigator: true, context: context, duration: Duration(milliseconds: 200), builder: (context) => Container( height: 300, child: Center(child: Text('I tuoi account')), ), ); },

I'm trying to open the bottom modal sheet but when I tap outside to dismiss the bottom sheet it throws the error:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/widgets/scroll_controller.dart': Failed assertion: line 201 pos 12: '_positions.isNotEmpty': ScrollController not attached to any scroll views. #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61) #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5) #2 ScrollController.animateTo (package:flutter/src/widgets/scroll_controller.dart:201:12) #3 ModalBottomSheetState.build. (package:modal_bottom_sheet/src/bottom_sheet.dart:417:27) #4 _StatusBarGestureDetectorState.build.. (package:modal_bottom_sheet/src/utils/scroll_to_top_status_bar.dart:47:40) #5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:315:24) #6 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:652:11) #7 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/t<…>

HaelArena avatar Apr 29 '24 22:04 HaelArena

I got the same error when clicking on top outside SafeArea

manhhaiphp avatar May 29 '24 05:05 manhhaiphp

GestureDetector( onLongPressUp: () { showCupertinoModalBottomSheet( isDismissible: true, backgroundColor: lightBlackNavBar, useRootNavigator: true, context: context, duration: Duration(milliseconds: 200), builder: (context) => Container( height: 300, child: Center(child: Text('I tuoi account')), ), ); },

I'm trying to open the bottom modal sheet but when I tap outside to dismiss the bottom sheet it throws the error:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/widgets/scroll_controller.dart': Failed assertion: line 201 pos 12: '_positions.isNotEmpty': ScrollController not attached to any scroll views. #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61) #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5) #2 ScrollController.animateTo (package:flutter/src/widgets/scroll_controller.dart:201:12) #3 ModalBottomSheetState.build. (package:modal_bottom_sheet/src/bottom_sheet.dart:417:27) #4 _StatusBarGestureDetectorState.build.. (package:modal_bottom_sheet/src/utils/scroll_to_top_status_bar.dart:47:40) #5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:315:24) #6 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:652:11) #7 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/t<…>

Do you have any solution?

linhkiubo98 avatar Aug 08 '24 03:08 linhkiubo98

I got the same error when clicking on top outside SafeArea

Do you have any solution for this?

linhkiubo98 avatar Aug 08 '24 08:08 linhkiubo98

same issue

ChaoQunPeng avatar Sep 03 '24 05:09 ChaoQunPeng