MarcelGarus / MarcelGarus/marquee

Unexpected null value error on even simple widget

Open
#86 6 comments 2 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
363
Forks
147
PR merge metrics
No merged PRs in 30d

Description

I am writing this widget
```dart
import 'package:flutter/material.dart';
import 'package:marquee/marquee.dart';

class TestScreen extends StatelessWidget {
const TestScreen({super.key});

@override
Widget build(BuildContext context) {
return Container(
child: SizedBox(
height: 50,
child: Marquee(
text: "Hello to this is sample marquee",
crossAxisAlignment: CrossAxisAlignment.center,
blankSpace: 20,
),
),
);
}
}

```

Eventhough the app runs and displays the marquee in terminal following error is shown

```log
Error: Unexpected null value.
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/priv
ate/ddc_runtime/errors.dart 266:49 throw_
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/priv
ate/ddc_runtime/operations.dart 528:63 nullCheck
packages/flutter/src/widgets/scroll_position.dart 141:49
get minScrollExtent
packages/flutter/src/widgets/scroll_position.dart 668:18
[_updateSemanticActions]
packages/flutter/src/widgets/scroll_position.dart 984:5
notifyListeners
packages/flutter/src/widgets/scroll_position.dart 384:5
forcePixels
packages/flutter/src/widgets/scroll_position_with_single_context.dart 197:7
jumpTo
packages/flutter/src/widgets/scroll_controller.dart 172:15
jumpTo
packages/marquee/marquee.dart 548:23

C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patc
h/async_patch.dart 84:54 runBody
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patc
h/async_patch.dart 123:5 _async
packages/marquee/marquee.dart 544:51

packages/flutter/src/scheduler/binding.dart 1175:15
[_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1113:9
handleDrawFrame
packages/flutter/src/scheduler/binding.dart 1015:5
[_handleDrawFrame]
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/platfor
m_dispatcher.dart 1168:13 invoke
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/platfor
m_dispatcher.dart 219:5 invokeOnDrawFrame
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/initial
ization.dart 195:45
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/priv
ate/ddc_runtime/operations.dart 334:14 _checkAndCall
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/priv
ate/ddc_runtime/operations.dart 339:39 dcall

```

Why is this happening and how to resolve this?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in packages/marquee/marquee.dart around lines 544-548, where the stack trace shows the widget calling ScrollController.jumpTo, and compare that with Flutter's scroll_position.dart failure at minScrollExtent. Reproduce the provided widget on Flutter web and identify why the scroll position is unavailable; done means the example no longer reports the unexpected null value while the marquee still displays.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.