Error: "PhantomGroupItem is not a subtype of type TextItem"
simonbengtsson opened this issue · comments
When creating a board similar to the example you can get the runtime error mentioned in the title when you drag items around. The error appears when the group item list is not of the exact runtime type List<AppFlowyGroupItem>
.
Here is an example of something that would cause the error to be thrown:
final items = ['Hello'].map((it) => TextItem(it))
AppFlowyGroupData(
id: 'one',
name: 'One',
items: items.toList(),
);
A workaround is to use the List.from
constructor:
final items = ['Hello'].map((it) => TextItem(it))
AppFlowyGroupData(
id: 'one',
name: 'One',
items: List<AppFlowyGroupItem>.from(items),
);
A workaround is to use the
List.from
constructor:final items = ['Hello'].map((it) => TextItem(it)) AppFlowyGroupData( id: 'one', name: 'One', items: List<AppFlowyGroupItem>.from(items), );
Thank you!