embraceitmobile / animated_tree_view

Animated TreeView based on AnimatedList allows building fully customizable Nodes that can be nested to infinite levels and children.
https://pub.dev/packages/animated_tree_view
MIT License
59 stars 29 forks source link

Error: Bad state: No element #8

Closed sbluhm closed 1 year ago

sbluhm commented 1 year ago

When loading the view, I receive the following stack trace. I cannot figure out what the issue is. Whether it is an issue in my code or in the module.

As far as I understand, the error is thrown by animated_tree_view. Can you confirm that?

My indexed tree only has two levels after root. 5 level 1 entries. the first two level 1 entries have 2 level 2 entries.

Error: Bad state: No element
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49  throw_
dart-sdk/lib/_internal/js_dev_runtime/private/js_array.dart 337:5             last]
packages/animated_tree_view/tree_view/animated_list_controller.dart 145:44    <fn>
dart-sdk/lib/async/future.dart 424:39                                         <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:19       internalCallback
Error: Bad state: No element
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49  throw_
dart-sdk/lib/_internal/js_dev_runtime/private/js_array.dart 337:5             last]
packages/animated_tree_view/tree_view/animated_list_controller.dart 145:44    <fn>
dart-sdk/lib/async/future.dart 424:39                                         <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:19       internalCallback
sbluhm commented 1 year ago

Closing. this was an issue with duplicate keys on different tree nodes. Keys need to be unique across the whole root node, not just a leaf.