flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

🐛 [firebase_database] Failed assertion: line 959 pos 12: 'index != null && index >= 0': is not true

Open Greatcallie opened this issue 5 years ago • 1 comments

Bug report

'package:flutter/src/widgets/animated_list.dart': Failed assertion: line 959 pos 12: 'index != null && index >= 0': is not true.

Steps to reproduce

Steps to reproduce the behavior:

  1. Use FirebaseAnimatedList on an empty database location
  2. add a child
  3. child is added to database but not shown in ui with the above error

Expected behavior

should simply work as before package upgrades and null safety

Click To Expand
I/flutter (32033): ----------------FIREBASE CRASHLYTICS----------------
I/flutter (32033): 'package:flutter/src/widgets/animated_list.dart': Failed assertion: line 959 pos 12: 'index != null && index >= 0': is not true.
I/flutter (32033): #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
I/flutter (32033): #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
I/flutter (32033): #2      SliverAnimatedListState.insertItem (package:flutter/src/widgets/animated_list.dart:959:12)
I/flutter (32033): #3      AnimatedListState.insertItem (package:flutter/src/widgets/animated_list.dart:484:42)
I/flutter (32033): #4      FirebaseAnimatedListState._onChildAdded (package:firebase_database/ui/firebase_animated_list.dart:175:36)
I/flutter (32033): #5      FirebaseSortedList._onChildAdded (package:firebase_database/ui/firebase_sorted_list.dart:97:18)
I/flutter (32033): #6      _rootRunUnary (dart:async/zone.dart:1436:47)
I/flutter (32033): #7      _CustomZone.runUnary (dart:async/zone.dart:1335:19)
I/flutter (32033): #8      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
I/flutter (32033): #9      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
I/flutter (32033): #10     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
I/flutter (32033): #11     _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)


Greatcallie avatar Oct 01 '21 00:10 Greatcallie

Hi @Greatcallie This looks like a duplicate of https://github.com/FirebaseExtended/flutterfire/issues/7100 Closing it as such Thank you

markusaksli-nc avatar Oct 01 '21 07:10 markusaksli-nc