Dimibe / grouped_list

A Flutter ListView in which items can be grouped into sections.
https://pub.dev/packages/grouped_list
MIT License
395 stars 106 forks source link

Fixes update to version 3.0 of flutter. #147

Closed UP929312 closed 2 years ago

UP929312 commented 2 years ago

This change will fix the error when using Flutter 3.0,

: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null. ../…/lib/grouped_list.dart:264

ekuleshov commented 2 years ago

@Dimibe unfortunately this fix make the last version of this package only compatible with Flutter 3, yet package sdk restrictions are at the level supported with Flutter 2.

It would be really nice if package supported both Flutter 2 and 3

To preserve backward compatibility with Flutter 2 the recommended way is to use this approach https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.0.0#your-code

For example: https://github.com/jonataslaw/getx/commit/9d2b87242aa5d5b54aebd4d635d1e16835635c49

Dimibe commented 2 years ago

Hi @ekuleshov, I will look into it. For the moment, just use the latest 4.x version of the grouped_list package if you are using Flutter 2

Dimibe commented 2 years ago

@ekuleshov Fixed in version 5.1.0

ekuleshov-idexx commented 2 years ago

Thank you!

ekuleshov commented 2 years ago

Spoke too soon. The package sdk requirement is still left at >=2.17.0 <3.0.0 To support Flutter 2 the dart sdk version need to be up to 2.16