-
Notifications
You must be signed in to change notification settings - Fork 526
Closed
Description
Problem description
Scrollable Positioned List 0.3.0 throws an error on compilation due to a failed null safety check, possibly with the Scheduler dependency? Does not occur with 0.2.3.
Steps to reproduce
- Add scrollable_positioned_list: ^0.3.0 to pubspec.yaml
- run
flutter pub get
- Add ScrollablePositionedList.builder logic to your app (e.g.
ScrollablePositionedList.builder(itemCount: 1, itemBuilder: (context, index) => Container()
) - Compilation fails.
- Reproduced using basic starter flutter app (android), adding just this one library, and adding the reference to the project (
home: ScrollablePositionedList.builder(itemCount: 1, itemBuilder: (context, index) => MyHomePage(title: 'Flutter Demo Home Page')) ,
Expected behavior
Compilation completes and app behaves as expected.
Actual behavior
Compilation failure, unable to run app at all
Environment
MacOS Monterey 12.3.1 (M1)
Additional details
Error received:
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Running Gradle task 'assembleDebug'...
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/scrollable_positioned_list-0.3.0/lib/src/scrollable_positioned_list.dart:438:33: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../development/flutter/packages/flutter/lib/src/scheduler/binding.dart').
Try calling using ?. instead.
SchedulerBinding.instance.addPostFrameCallback((_) {
^^^^^^^^^^^^^^^^^^^^
SogoCZE, chirastefan and martingeorgiu
Metadata
Metadata
Assignees
Labels
No labels