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: "PhantomGroupItem is not a subtype of type TextItem" #4

Open
simonbengtsson opened this issue Mar 10, 2023 · 2 comments
Open

Comments

@simonbengtsson
Copy link

simonbengtsson commented Mar 10, 2023

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),
);
@WizMe-M
Copy link

WizMe-M commented Aug 29, 2023

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!

@Cunningham16
Copy link

Thanks for helping, bro!

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

3 participants