Skip to content

Commit

Permalink
Make backwards compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimibe committed May 26, 2022
1 parent f18ff77 commit 71f7c3a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/grouped_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ class _GroupedListViewState<T, E> extends State<GroupedListView<T, E>> {
RenderBox? _headerBox;
RenderBox? _listBox;

/// Fix for backwards compatability
///
/// See:
/// * https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.0.0#your-code
I? _ambiguate<I>(I? value) => value;

@override
void initState() {
_controller = widget.controller ?? ScrollController();
Expand Down Expand Up @@ -262,7 +268,7 @@ class _GroupedListViewState<T, E> extends State<GroupedListView<T, E>> {
var isSeparator = widget.reverse ? (int i) => i.isOdd : (int i) => i.isEven;

if (widget.reverse) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_ambiguate(WidgetsBinding.instance)!.addPostFrameCallback((_) {
_scrollListener();
});
}
Expand Down

0 comments on commit 71f7c3a

Please sign in to comment.