Dimibe / sticky_grouped_list

A ScrollablePositionedList in which items can be grouped into sections with sticky headers.
https://pub.dev/packages/sticky_grouped_list
MIT License
184 stars 71 forks source link

LateInitializationError: Field '_stickyGroupedListViewState@217225506' has not been initialized. #30

Closed ericel closed 3 years ago

ericel commented 3 years ago

I get this error message with the Prerelease: 2.0.0-nullsafety.1

════════ Exception caught by widgets library ═══════════════════════════════════ The following LateError was thrown building Container(padding: EdgeInsets(18.0, 0.0, 18.0, 75.0)): LateInitializationError: Field '_stickyGroupedListViewState@217225506' has not been initialized.

The relevant error-causing widget was Container lib/…/state_widgets/chat_home_widget.dart:106 When the exception was thrown, this was the stack

0 GroupedItemScrollController._stickyGroupedListViewState (package:sticky_grouped_list/sticky_grouped_list.dart)

package:sticky_grouped_list/sticky_grouped_list.dart:1

1 GroupedItemScrollController._bind

package:sticky_grouped_list/sticky_grouped_list.dart:382

2 _StickyGroupedListViewState.initState

package:sticky_grouped_list/sticky_grouped_list.dart:178

3 StatefulElement._firstBuild

package:flutter/…/widgets/framework.dart:4632

4 ComponentElement.mount

package:flutter/…/widgets/framework.dart:4469

domzinhuu commented 3 years ago

I have the same problem! somebody help??

kitty433cute commented 3 years ago

agree same need help

sdhiaeddine commented 3 years ago

I think the

assert(_stickyGroupedListViewState == null);

here is the one throwing the exception

bettdouglas commented 3 years ago

Has anyone managed to fix this?

minhdanh commented 3 years ago

The issue has been mentioned here: https://github.com/Dimibe/sticky_grouped_list/pull/29#pullrequestreview-649497547 For now I think the solution for us is to fork the repo and fix it ourselves, until the author has time to fix this.

bettdouglas commented 3 years ago

Thanks, I ended up going that direction. Worked well

kimmanwky commented 3 years ago

Is anyone that fixed the issue and don't mind sharing their repo for temporarily solution?

minhdanh commented 3 years ago

@kimmanwky It's very easy, you can check my repo here: https://github.com/minhdanh/sticky_grouped_list/tree/feature/null-safety

However I ended up not using this package anymore, I used this instead: https://github.com/Dimibe/grouped_list (Same author, but more up to date I think)

Dimibe commented 3 years ago

Hi all, sorry for the late reponse. I will fix this problem most likely today and release a new major version with null safety.

kimmanwky commented 3 years ago

@kimmanwky It's very easy, you can check my repo here: https://github.com/minhdanh/sticky_grouped_list/tree/feature/null-safety

However I ended up not using this package anymore, I used this instead: https://github.com/Dimibe/grouped_list (Same author, but more up to date I think)

Interesting! Let me check out the another package if it will suit better. Thanks!

Dimibe commented 3 years ago

Fixed with version 2.0.0-nullsafety.2