Repository: flutter
Issue: Crash in SliverAnimatedList: AssertionError in Debug mode / "Null check operator used on a null value" in Release mode
Labels: c: crash,framework,f: scrolling,a: error message,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.24,found in release: 3.25

EDIT: I created a much better example code, with much better step by step instructions to reproduce. See here: https://github.com/flutter/flutter/issues/153922#issuecomment-2304830850

### Steps to reproduce

Run the provided code sample and quickly change the text in the filter field.
You'll hit the bug almost instantly after a few characters and delete key presses.

### Expected results

The filter text field should filter the items of the list.

Changing `SilverAnimatedList` to `AnimatedList` in the code sample, fixes the issue as the app becomes impossible to crash, however, it makes me lose the possibility to use the `findChildIndexCallback` property of `SliverAnimatedList` which is not available in its non sliver counterpart.



### Actual results

In debug mode, an assertion fails, as shown in the logs.
In release mode, a null check fails, as shown in the other block of logs.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text("Conversations"),
        ),
        body: ConversationsWidget(),
      ),
    )
  );
}


class ConversationsWidget extends StatefulWidget {
  final List<String> conversations = [
      "John Doe",
      "Jane Doe",
      "Alice",
      "Bob",
      "Charlie",
      "David",
      "Eve",
      "Frank",
      "Grace",
      "Heidi",
      "Ivan",
      "Judy",
      "Mallory",
      "Oscar",
      "Peggy",
      "Trent",
      "Victor",
      "Walter",
      "Zoe",
      "Mallory",
  ];
  ConversationsWidget({super.key});

  @override
  State<ConversationsWidget> createState() => _SearchWidgetState();
}

class _SearchWidgetState extends State<ConversationsWidget> {
  final GlobalKey<SliverAnimatedListState> _listKey = GlobalKey<SliverAnimatedListState>();
  late final ListModel<String> _list = ListModel<String>(
    listKey: _listKey,
    initialItems: widget.conversations,
    removedItemBuilder: _buildRemovedItem,
  );

  late final TextEditingController filterController = TextEditingController();
  late final FocusNode filterFocus = FocusNode();

  @override
  void dispose() {
    filterController.dispose();
    filterFocus.dispose();
    super.dispose();
  }

  @override
  void didUpdateWidget(ConversationsWidget oldWidget) {
    super.didUpdateWidget(oldWidget);
    if (widget.conversations != oldWidget.conversations) {
      _onChanged();
    }
  }

  Widget _buildItem(BuildContext context, int index, Animation<double> animation) {
    print("calling _buildItem at index $index");
    return _buildConversationTile(
      context, animation,  _list[index]
    );
  }

  Widget _buildRemovedItem(
    String item, BuildContext context, Animation<double> animation) {
    return _buildConversationTile(
      context, animation, item
    );
  }

  void _onChanged() {
    setState(() {
      
    });
    final convs = widget.conversations;

    final filterNormalized = filterController.text.toLowerCase();
    final filteredConvs = convs.where((conv) => conv.toLowerCase().contains(filterNormalized)).toList();

    for (final conv in filteredConvs) {
      if (!_list._items.contains(conv)) {
        _list.insert(filteredConvs.indexOf(conv), conv);
      }
    }

    final itemsCopy = List<String>.from(_list._items);
    int offset = 0;
    for (final (i, conv) in itemsCopy.indexed) {
      if (!filteredConvs.contains(conv)) {
        _list.removeAt(i-offset);
        offset++;
      }
    }
  }

  @override
  Widget build(BuildContext context) {

        return Column(
          children: [
            Row(
              children: [
                const Icon(Icons.filter_list),
                Expanded(
                  child: TextField(
                    focusNode: filterFocus,
                    controller: filterController,
                    autocorrect: false,
                    autofillHints: const [
                      AutofillHints.nickname,
                      AutofillHints.givenName,
                      AutofillHints.name,
                      AutofillHints.username
                    ],
                    keyboardType: TextInputType.name,
                    decoration: const InputDecoration(
                      hintText: 'Filter...',
                      hintStyle: TextStyle(color: Colors.grey),
                      hintFadeDuration: Durations.medium1,
                      border: InputBorder.none,
                    ),
                    onChanged: (_) => _onChanged(),
                    onTapOutside: (_) => filterFocus.unfocus(),
                  ),
                ),
                IconButton(
                  icon: const Icon(Icons.clear),
                  color: Colors.grey[600],
                  onPressed: () {
                    filterController.clear();
                    _onChanged();
                  },
                )
              ],
            ),
            Expanded(
              child: CustomScrollView(
                slivers: <Widget>[
                  SliverAnimatedList(
                    key: _listKey,
                    findChildIndexCallback: (key) {
                      final k = (key as ValueKey).value as String;
                      final i = _list.indexWhere((conv) => conv == k);
                      return i == -1 ? null : i;
                    },
                    initialItemCount: _list.length,
                    itemBuilder: _buildItem,
                  ),
                ],
              ),
            ),
          ],
        );
  }
}

typedef RemovedItemBuilder<E> = Widget Function(
    E item, BuildContext context, Animation<double> animation);

class ListModel<E> {
  ListModel({
    required this.listKey,
    required this.removedItemBuilder,
    Iterable<E>? initialItems,
  }) : _items = List<E>.from(initialItems ?? <E>[]);

  final GlobalKey<SliverAnimatedListState> listKey;
  final RemovedItemBuilder<E> removedItemBuilder;
  final List<E> _items;

  SliverAnimatedListState get _animatedList => listKey.currentState!;

  void insert(int index, E item) {
    _items.insert(index, item);
    _animatedList.insertItem(index, duration: const Duration(milliseconds: 800));
  }

  E removeAt(int index) {
    final E removedItem = _items.removeAt(index);
    if (removedItem != null) {
      _animatedList.removeItem(
        index,
        duration: const Duration(milliseconds: 800),
        (BuildContext context, Animation<double> animation) =>
            removedItemBuilder(removedItem, context, animation),
      );
    }
    return removedItem;
  }

  int get length => _items.length;

  E operator [](int index) => _items[index];

  int indexOf(E item) => _items.indexOf(item);
  int indexWhere(bool Function(E) test) => _items.indexWhere(test);
}


Widget _buildConversationTile(BuildContext context, Animation<double> animation, String name) {
  return TileTransition(
    key: ValueKey(name),
    animation: animation, 
    child: ListTile(
      leading: const Icon(Icons.person),
      title: Text(name),
      onTap: () {
      },
    ),
  );
}

class TileTransition extends StatelessWidget {
  final Widget child;
  final Animation<double> animation;

  const TileTransition({
    super.key, 
    required this.child,
    required this.animation,
  });

  @override
  Widget build(BuildContext context) {
    return SizeTransition(
      key: key,
      sizeFactor: animation.drive(CurveTween(curve: Curves.easeInOutCubic)),
      child: SlideTransition(
        position: Tween<Offset>(begin: const Offset(1,0), end: const Offset(0,0)).animate(CurvedAnimation(
          parent: animation,
          curve: Curves.easeOutCubic,
        )),
        child: FadeTransition(
          opacity: Tween<double>(begin: 0, end: 1).animate(CurvedAnimation(
            parent: animation,
            curve: const Interval(0.5, 1.0),
          )),
          child: child,
        ),
      )
    );//.animate().color(end: Colors.red, delay: Duration(milliseconds: 500));
  }
  
}

```

</details>


### Screenshots or Video

_No response_

### Logs

<details open><summary>Debug Logs</summary>

```console
Restarted application in 1,116ms.
I/flutter (31340): calling _buildItem at index 0
I/flutter (31340): calling _buildItem at index 1
I/flutter (31340): calling _buildItem at index 2
I/flutter (31340): calling _buildItem at index 3
I/flutter (31340): calling _buildItem at index 4
I/flutter (31340): calling _buildItem at index 5
I/flutter (31340): calling _buildItem at index 6
I/flutter (31340): calling _buildItem at index 7
I/flutter (31340): calling _buildItem at index 8
I/flutter (31340): calling _buildItem at index 9
I/flutter (31340): calling _buildItem at index 10
I/flutter (31340): calling _buildItem at index 11
I/flutter (31340): calling _buildItem at index 12
I/flutter (31340): calling _buildItem at index 13
I/flutter (31340): calling _buildItem at index 14
I/flutter (31340): calling _buildItem at index 15
I/flutter (31340): calling _buildItem at index 16
I/flutter (31340): calling _buildItem at index 17
W/Choreographer(31340): Frame time is 0.153323 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
I/ImeTracker(31340): com.test.test:3dd6aa77: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false
D/InputMethodManager(31340): showSoftInput() view=io.flutter.embedding.android.FlutterView{30e961e VFED..... .F....ID 0,0-1080,2277 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/AssistStructure(31340): Flattened final assist data: 596 bytes, containing 1 windows, 3 views
D/InputConnectionAdaptor(31340): The input method toggled cursor monitoring on
D/InsetsController(31340): show(ime(), fromIme=true)
W/InteractionJankMonitor(31340): Initializing without READ_DEVICE_CONFIG permission. enabled=false, interval=1, missedFrameThreshold=3, frameTimeThreshold=64, package=com.test.test
I/ImeTracker(31340): com.test.test:3dd6aa77: onShown
I/ImeTracker(31340): com.test.test:7d2b217f: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false
D/InputMethodManager(31340): showSoftInput() view=io.flutter.embedding.android.FlutterView{30e961e VFED..... .F...... 0,0-1080,2277 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31340): show(ime(), fromIme=true)
I/ImeTracker(31340): com.test.test:7d2b217f: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
I/flutter (31340): calling _buildItem at index 0
I/flutter (31340): calling _buildItem at index 1
I/flutter (31340): calling _buildItem at index 2
I/flutter (31340): calling _buildItem at index 0
I/flutter (31340): calling _buildItem at index 1
I/flutter (31340): calling _buildItem at index 2
I/ImeTracker(31340): com.test.test:5216683c: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false
D/InputMethodManager(31340): showSoftInput() view=io.flutter.embedding.android.FlutterView{30e961e VFED..... .F...... 0,0-1080,2277 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31340): show(ime(), fromIme=true)
I/ImeTracker(31340): com.test.test:5216683c: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
I/flutter (31340): calling _buildItem at index 0
I/flutter (31340): calling _buildItem at index 1
I/flutter (31340): calling _buildItem at index 2
I/flutter (31340): calling _buildItem at index 4
I/flutter (31340): calling _buildItem at index 9
I/flutter (31340): calling _buildItem at index 3
I/flutter (31340): calling _buildItem at index 5
I/flutter (31340): calling _buildItem at index 6
I/flutter (31340): calling _buildItem at index 7
I/flutter (31340): calling _buildItem at index 8
I/flutter (31340): calling _buildItem at index 10
I/flutter (31340): calling _buildItem at index 11
I/flutter (31340): calling _buildItem at index 12
I/flutter (31340): calling _buildItem at index 13
I/flutter (31340): calling _buildItem at index 14
I/flutter (31340): calling _buildItem at index 15
I/flutter (31340): calling _buildItem at index 16
I/flutter (31340): calling _buildItem at index 17
I/flutter (31340): calling _buildItem at index 18
I/ImeTracker(31340): com.test.test:5daf4e56: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false
D/InputMethodManager(31340): showSoftInput() view=io.flutter.embedding.android.FlutterView{30e961e VFED..... .F...... 0,0-1080,2277 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31340): show(ime(), fromIme=true)
I/ImeTracker(31340): com.test.test:5daf4e56: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
I/flutter (31340): calling _buildItem at index 0
I/flutter (31340): calling _buildItem at index 1
I/ImeTracker(31340): com.test.test:a878887b: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false
D/InputMethodManager(31340): showSoftInput() view=io.flutter.embedding.android.FlutterView{30e961e VFED..... .F...... 0,0-1080,2277 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31340): show(ime(), fromIme=true)
I/ImeTracker(31340): com.test.test:a878887b: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
I/flutter (31340): calling _buildItem at index 0
I/ImeTracker(31340): com.test.test:67dc10a9: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false
D/InputMethodManager(31340): showSoftInput() view=io.flutter.embedding.android.FlutterView{30e961e VFED..... .F...... 0,0-1080,2277 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31340): show(ime(), fromIme=true)
I/ImeTracker(31340): com.test.test:67dc10a9: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
I/flutter (31340): calling _buildItem at index 0
I/flutter (31340): calling _buildItem at index 1
I/flutter (31340): calling _buildItem at index 2
I/flutter (31340): calling _buildItem at index 3
I/ImeTracker(31340): com.test.test:9e9e0b0c: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser false
D/InputMethodManager(31340): showSoftInput() view=io.flutter.embedding.android.FlutterView{30e961e VFED..... .F...... 0,0-1080,2277 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31340): show(ime(), fromIme=true)
I/ImeTracker(31340): com.test.test:9e9e0b0c: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
I/flutter (31340): calling _buildItem at index 0
I/flutter (31340): calling _buildItem at index 1
I/flutter (31340): calling _buildItem at index 2
I/flutter (31340): calling _buildItem at index 3
I/flutter (31340): calling _buildItem at index 4
I/flutter (31340): calling _buildItem at index 5
I/flutter (31340): calling _buildItem at index 6
I/flutter (31340): calling _buildItem at index 7
I/flutter (31340): calling _buildItem at index 8
I/flutter (31340): calling _buildItem at index 9
I/flutter (31340): calling _buildItem at index 10
I/flutter (31340): calling _buildItem at index 11
I/flutter (31340): calling _buildItem at index 12
I/flutter (31340): calling _buildItem at index 13
I/flutter (31340): calling _buildItem at index 14
I/flutter (31340): calling _buildItem at index 15
I/flutter (31340): calling _buildItem at index 16
I/flutter (31340): calling _buildItem at index 17
I/flutter (31340): calling _buildItem at index 18

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building SliverAnimatedList-[LabeledGlobalKey<SliverAnimatedListState>#f1275](state: SliverAnimatedListState#a9f18(tickers: tracking 36 tickers)):
'package:flutter/src/rendering/sliver_multi_box_adaptor.dart': Failed assertion: line 269 pos 16: 'child == null || indexOf(child) > index': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.yml

The relevant error-causing widget was:
    SliverAnimatedList-[LabeledGlobalKey<SliverAnimatedListState>#f1275] SliverAnimatedList:file:///home/paulg/Repos/test_client/lib/main.dart:154:19

When the exception was thrown, this was the stack:
#2      RenderSliverMultiBoxAdaptor._debugVerifyChildOrder (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:269:16)
#3      RenderSliverMultiBoxAdaptor.debugChildIntegrityEnabled=.<anonymous closure> (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:243:14)
#4      RenderSliverMultiBoxAdaptor.debugChildIntegrityEnabled= (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:245:6)
#5      SliverMultiBoxAdaptorElement.performRebuild (package:flutter/src/widgets/sliver.dart:933:20)
#6      SliverMultiBoxAdaptorElement.update (package:flutter/src/widgets/sliver.dart:844:7)
#7      Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#8      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#9      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5780:11)
#10     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#11     StatefulElement.update (package:flutter/src/widgets/framework.dart:5803:5)
#12     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#13     Element.updateChildren (package:flutter/src/widgets/framework.dart:4090:32)
#14     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:7060:17)
#15     _ViewportElement.update (package:flutter/src/widgets/viewport.dart:235:11)
#16     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#17     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
#18     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#19     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
#20     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#21     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
#22     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#23     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
#24     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#25     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#26     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5780:11)
#27     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#28     StatefulElement.update (package:flutter/src/widgets/framework.dart:5803:5)
#29     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#30     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
#31     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#32     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#33     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#34     ProxyElement.update (package:flutter/src/widgets/framework.dart:5946:5)
#35     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#36     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
#37     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#38     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#39     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#40     ProxyElement.update (package:flutter/src/widgets/framework.dart:5946:5)
#41     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#42     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
#43     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#44     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6907:14)
#45     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#46     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#47     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5780:11)
#48     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#49     StatefulElement.update (package:flutter/src/widgets/framework.dart:5803:5)
#50     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#51     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#52     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#53     ProxyElement.update (package:flutter/src/widgets/framework.dart:5946:5)
#54     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#55     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#56     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5780:11)
#57     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#58     StatefulElement.update (package:flutter/src/widgets/framework.dart:5803:5)
#59     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#60     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#61     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5780:11)
#62     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#63     StatefulElement.update (package:flutter/src/widgets/framework.dart:5803:5)
#64     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#65     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#66     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#67     ProxyElement.update (package:flutter/src/widgets/framework.dart:5946:5)
#68     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#69     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#70     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#71     StatelessElement.update (package:flutter/src/widgets/framework.dart:5693:5)
#72     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#73     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#74     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#75     ProxyElement.update (package:flutter/src/widgets/framework.dart:5946:5)
#76     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#77     Element.updateChildren (package:flutter/src/widgets/framework.dart:4090:32)
#78     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:7060:17)
#79     Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
#80     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5642:16)
#81     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5780:11)
#82     Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#83     BuildScope._tryRebuild (package:flutter/src/widgets/framework.dart:2693:15)
#84     BuildScope._flushDirtyElements (package:flutter/src/widgets/framework.dart:2752:11)
#85     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:3048:18)
#86     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1162:21)
#87     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:468:5)
#88     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1397:15)
#89     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1318:9)
#90     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1176:5)
#91     _invoke (dart:ui/hooks.dart:312:13)
#92     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:419:5)
#93     _drawFrame (dart:ui/hooks.dart:283:31)
(elided 2 frames from class _AssertionError)
════════════════════════════════════════════════════════════════════════════════

```

</details>

<details open><summary>Debug Logs</summary>

```console
I/flutter (32456): [IMPORTANT:flutter/shell/platform/android/android_context_vulkan_impeller.cc(67)] Using the Impeller rendering backend (Vulkan).
I/flutter (32456): calling _buildItem at index 0
I/flutter (32456): calling _buildItem at index 1
I/flutter (32456): calling _buildItem at index 2
I/flutter (32456): calling _buildItem at index 3
I/flutter (32456): calling _buildItem at index 4
I/flutter (32456): calling _buildItem at index 5
I/flutter (32456): calling _buildItem at index 6
I/flutter (32456): calling _buildItem at index 7
I/flutter (32456): calling _buildItem at index 8
I/flutter (32456): calling _buildItem at index 9
I/flutter (32456): calling _buildItem at index 10
I/flutter (32456): calling _buildItem at index 11
I/flutter (32456): calling _buildItem at index 12
I/flutter (32456): calling _buildItem at index 13
I/flutter (32456): calling _buildItem at index 14
I/flutter (32456): calling _buildItem at index 15
I/flutter (32456): calling _buildItem at index 16
I/flutter (32456): calling _buildItem at index 17
I/flutter (32456): calling _buildItem at index 0
I/flutter (32456): calling _buildItem at index 1
I/flutter (32456): calling _buildItem at index 0
I/flutter (32456): calling _buildItem at index 1
I/flutter (32456): calling _buildItem at index 2
I/flutter (32456): calling _buildItem at index 3
I/flutter (32456): calling _buildItem at index 4
I/flutter (32456): calling _buildItem at index 5
I/flutter (32456): calling _buildItem at index 6
I/flutter (32456): calling _buildItem at index 7
I/flutter (32456): calling _buildItem at index 8
I/flutter (32456): calling _buildItem at index 9
I/flutter (32456): calling _buildItem at index 10
I/flutter (32456): calling _buildItem at index 11
I/flutter (32456): calling _buildItem at index 5
I/flutter (32456): calling _buildItem at index 6
I/flutter (32456): calling _buildItem at index 7
I/flutter (32456): calling _buildItem at index 8
I/flutter (32456): calling _buildItem at index 9
I/flutter (32456): calling _buildItem at index 10
I/flutter (32456): calling _buildItem at index 11
I/flutter (32456): calling _buildItem at index 12
I/flutter (32456): calling _buildItem at index 0
I/flutter (32456): calling _buildItem at index 1
I/flutter (32456): calling _buildItem at index 2
I/flutter (32456): calling _buildItem at index 3
I/flutter (32456): calling _buildItem at index 4
I/flutter (32456): calling _buildItem at index 0
I/flutter (32456): calling _buildItem at index 1
I/flutter (32456): calling _buildItem at index 2
I/flutter (32456): calling _buildItem at index 3
I/flutter (32456): calling _buildItem at index 4
I/flutter (32456): Null check operator used on a null value
I/flutter (32456): #0      RenderSliverMultiBoxAdaptor.childMainAxisPosition (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:627)
I/flutter (32456): #1      RenderSliverMultiBoxAdaptor.paint (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:693)
I/flutter (32456): #2      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268)
I/flutter (32456): #3      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:251)
I/flutter (32456): #4      RenderViewportBase._paintContents (package:flutter/src/rendering/viewport.dart:757)
I/flutter (32456): #5      PaintingContext.pushLayer (package:flutter/src/rendering/object.dart:487)
I/flutter (32456): #6      PaintingContext.pushClipRect (package:flutter/src/rendering/object.dart:547)
I/flutter (32456): #7      RenderViewportBase.paint (package:flutter/src/rendering/viewport.dart:732)
I/flutter (32456): #8      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3268)
I/flutter (32456): #9      PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:167)
I/flutter (32456): #10     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:110)
I/flutter (32456): #11     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1183)
I/flutter (32456): #12     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1193)
I/flutter (32456): #13     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:604)
I/flutter (32456): #14     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1164)
I/flutter (32456): #15     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:468)
I/flutter (32456): #16     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1397)
I/flutter (32456): #17     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1318)
I/flutter (32456): #18     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1176)
I/flutter (32456): #19     _invoke (dart:ui/hooks.dart:312)
I/flutter (32456): #20     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:419)
I/flutter (32456): #21     _drawFrame (dart:ui/hooks.dart:283)
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): calling _buildItem at index 0
I/flutter (32456): calling _buildItem at index 1
I/flutter (32456): calling _buildItem at index 2
I/flutter (32456): calling _buildItem at index 3
I/flutter (32456): calling _buildItem at index 4
I/flutter (32456): calling _buildItem at index 5
I/flutter (32456): calling _buildItem at index 6
I/flutter (32456): calling _buildItem at index 7
I/flutter (32456): calling _buildItem at index 8
I/flutter (32456): calling _buildItem at index 9
I/flutter (32456): calling _buildItem at index 10
I/flutter (32456): calling _buildItem at index 11
I/flutter (32456): calling _buildItem at index 12
I/flutter (32456): calling _buildItem at index 13
I/flutter (32456): calling _buildItem at index 14
I/flutter (32456): calling _buildItem at index 15
I/flutter (32456): calling _buildItem at index 16
I/flutter (32456): calling _buildItem at index 17
I/flutter (32456): calling _buildItem at index 18
I/flutter (32456): calling _buildItem at index 19
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): calling _buildItem at index 0
I/flutter (32456): calling _buildItem at index 1
I/flutter (32456): calling _buildItem at index 2
I/flutter (32456): calling _buildItem at index 3
I/flutter (32456): calling _buildItem at index 4
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): calling _buildItem at index 0
I/flutter (32456): calling _buildItem at index 1
I/flutter (32456): calling _buildItem at index 2
I/flutter (32456): calling _buildItem at index 3
I/flutter (32456): calling _buildItem at index 4
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): calling _buildItem at index 0
I/flutter (32456): calling _buildItem at index 1
I/flutter (32456): calling _buildItem at index 2
I/flutter (32456): calling _buildItem at index 3
I/flutter (32456): calling _buildItem at index 4
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'
I/flutter (32456): Another exception was thrown: Instance of 'DiagnosticsProperty<void>'

```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[!] Flutter (Channel stable, 3.24.1-0.0.pre.1, on NixOS 24.05 (Uakari) 6.8.12, locale en_US.UTF-8)
    • Flutter version 3.24.1-0.0.pre.1 on channel stable at /home/paulg/Repos/flutter
    ! Upstream repository git@github.com:PaulGrandperrin/flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to git@github.com:PaulGrandperrin/flutter.git to dismiss this error.
    • Framework revision e917673199 (5 days ago), 2024-08-17 20:19:14 +0200
    • Engine revision b8800d88be
    • Dart version 3.5.0
    • DevTools version 2.37.2
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and
      upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /nix/store/nzwnj7rq8a6cvzbsszf4n9zfvx101zm5-androidsdk/libexec/android-sdk
    • Platform android-34, build-tools 30.0.3
    • ANDROID_HOME = /nix/store/nzwnj7rq8a6cvzbsszf4n9zfvx101zm5-androidsdk/libexec/android-sdk
    • ANDROID_SDK_ROOT = /nix/store/nzwnj7rq8a6cvzbsszf4n9zfvx101zm5-androidsdk/libexec/android-sdk
    • Java binary at: /nix/store/l7pwy1rxdrb13svqandm720d06fycd8c-openjdk-17.0.11+9/lib/openjdk/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+9-nixos)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /nix/store/cg5bvzxml5bbdw8wlrywb6q7hpdjq0ij-google-chrome-127.0.6533.88/bin/google-chrome-stable

[✓] Linux toolchain - develop for Linux desktop
    • clang version 16.0.6
    • cmake version 3.29.6
    • ninja version 1.12.1
    • pkg-config version 0.29.2

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).

[✓] Connected device (3 available)
    • Pixel 7 Pro (mobile) • 192.168.1.13:33015 • android-arm64  • Android 15 (API 35)
    • Linux (desktop)      • linux              • linux-x64      • NixOS 24.05 (Uakari) 6.8.12
    • Chrome (web)         • chrome             • web-javascript • Google Chrome 127.0.6533.88

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.
```

</details>