huhuang03 / reorderable_grid_view

MIT License
46 stars 33 forks source link

ScrollableState is nullable bug #61

Closed aygunoz closed 1 year ago

aygunoz commented 1 year ago

Hello Dear,

I just got upgrade and I get below build error right now.

Thank You


../../development/flutter/.pub-cache/hosted/pub.dartlang.org/reorderable_grid_view-2.2.6-alpha.13/lib/src/drag_info.dart:93:29: Error: A value of type 'ScrollableState?' can't be assigned to a variable of type 'ScrollableState' because 'ScrollableState?' is nullable and 'ScrollableState' isn't.
 - 'ScrollableState' is from 'package:flutter/src/widgets/scrollable.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/scrollable.dart').
    scrollable = Scrollable.of(item.context);
                            ^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/reorderable_grid_view-2.2.6-alpha.13/lib/src/drag_info.dart:153:19: Error: A value of type 'OverlayState?' can't be returned from a function with return type 'OverlayState' because 'OverlayState?' is nullable and 'OverlayState' isn't.
 - 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/overlay.dart').
    return overlay?? Overlay.of(context);
                  ^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/reorderable_grid_view-2.2.6-alpha.13/lib/src/drag_info.dart:93:29: Error: A value of type 'ScrollableState?' can't be assigned to a variable of type 'ScrollableState' because 'ScrollableState?' is nullable and 'ScrollableState' isn't.
 - 'ScrollableState' is from 'package:flutter/src/widgets/scrollable.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/scrollable.dart').
    scrollable = Scrollable.of(item.context);
                            ^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/reorderable_grid_view-2.2.6-alpha.13/lib/src/drag_info.dart:153:19: Error: A value of type 'OverlayState?' can't be returned from a function with return type 'OverlayState' because 'OverlayState?' is nullable and 'OverlayState' isn't.
 - 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/overlay.dart').
    return overlay?? Overlay.of(context);
                  ^
Restarted application in 690ms.
Unhandled exception:
Null check operator used on a null value
#0      IncrementalCompiler.compileExpression.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:1944:69)
#1      CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:46)
#2      new Future.sync (dart:async/future.dart:302:31)
#3      CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:19)
#4      _rootRun (dart:async/zone.dart:1391:13)
#5      _CustomZone.run (dart:async/zone.dart:1293:19)
#6      _runZoned (dart:async/zone.dart:1829:10)
#7      runZoned (dart:async/zone.dart:1751:10)
#8      CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:117:12)
#9      IncrementalCompiler.compileExpression (package:front_end/src/fasta/incremental_compiler.dart:1822:26)
#10     IncrementalCompiler.compileExpression (package:vm/incremental_compiler.dart:237:23)
#11     FrontendCompiler.compileExpression (package:frontend_server/frontend_server.dart:875:44)
#12     listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1307:20)
#13     _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
#14     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#15     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#16     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)
#17     _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)
#18     _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)
#19     _LineSplitterSink._addLines (dart:convert/line_splitter.dart:170:13)
#20     _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:145:5)
#21     StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5)
#22     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#23     _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
#24     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#25     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#26     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)
#27     _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)
#28     _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)
#29     _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243:7)
#30     _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317:20)
#31     _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)
#32     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
#33     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#34     _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
#35     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#36     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#37     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#38     _StreamController._add (dart:async/stream_controller.dart:648:7)
#39     _StreamController.add (dart:async/stream_controller.dart:596:5)
#40     _Socket._onData (dart:io-patch/socket_patch.dart:2324:41)
#41     _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
#42     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#43     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#44     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#45     _StreamController._add (dart:async/stream_controller.dart:648:7)
#46     _StreamController.add (dart:async/stream_controller.dart:596:5)
#47     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1849:33)
#48     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1322:14)
#49     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#50     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#51     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:122:13)
#52     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5)
the Dart compiler exited unexpectedly.
the Dart compiler exited unexpectedly.
huhuang03 commented 1 year ago

Looks like your flutter version Overlay.of(context) and Scrollable.of(context) return a Overlay?, Scrollable?. And mine return Overlay, Scrollable.

Fixed in 2.2.6-alpha.14

aygunoz commented 1 year ago

Yes, It fixed thank you.