Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while adding list of grid view widget('package:reorderable_grid_view/reorderable_grid_view.dart': Failed assertion: line 192 pos 12: 'toWrap.key != null': is not true.) #5

Closed
guruprasadhj opened this issue Jul 1, 2021 · 2 comments

Comments

@guruprasadhj
Copy link

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown building ReorderableGridView(dirty, dependencies: [_EffectiveTickerMode], state: _ReorderableGridViewState#af733(tickers: tracking 1 ticker)):
'package:reorderable_grid_view/reorderable_grid_view.dart': Failed assertion: line 192 pos 12: 'toWrap.key != null': is not true.

The relevant error-causing widget was:
ReorderableGridView file:///D:/workspace/ziya_launcher/lib/main.dart:54:21
When the exception was thrown, this was the stack:
#2 _ReorderableGridViewState._wrap (package:reorderable_grid_view/reorderable_grid_view.dart:192:12)
#3 _ReorderableGridViewState.build (package:reorderable_grid_view/reorderable_grid_view.dart:341:20)
#4 StatefulElement.build (package:flutter/src/widgets/framework.dart:4691:27)
#5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4574:15)
#6 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
...
════════════════════════════════════════════════════════════════════════════════════════════════════

@huhuang03
Copy link
Owner

huhuang03 commented Jul 2, 2021

Looks like you need specify a key to the grid child.

return Card(
    // specify a key.
    key: ValueKey(text),
    child: Text(text),
);

@huhuang03
Copy link
Owner

I will close the issuse because it's seems solved. Please reopen it if still happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants