tp7309 / flutter_sticky_and_expandable_list

粘性头部与分组列表Sliver实现 Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.
MIT License
141 stars 27 forks source link

unable to build Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null. #43

Closed fullflash closed 2 years ago

fullflash commented 2 years ago
      ] ../../../../.pub-cache/hosted/pub.dartlang.org/sticky_and_expandable_list-1.1.0/lib/src/expandable_section_container.dart:170:31: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.
../…/src/expandable_section_container.dart:170
[        ]  - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../SDK_all/flutter/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1

[        ] Try calling using ?. instead.
[        ]       WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
[        ]                               ^^^^^^^^^^^^^^^^^^^^
[        ] ../../../../.pub-cache/hosted/pub.dartlang.org/sticky_and_expandable_list-1.1.0/lib/src/sliver_expandable_list.dart:414:31: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.
../…/src/sliver_expandable_list.dart:414
[        ]  - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../SDK_all/flutter/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
[        ] Try calling using ?. instead.
[        ]       WidgetsBinding.instance.addPostFrameCallback((_) {
tp7309 commented 2 years ago

it seems that you use a older flutter version, try old library version, like v1.0.3.

fullflash commented 2 years ago

thanks