Floor. Column type is not supported for List<>

755 views Asked by At

I use the floor as SQLite abstraction in a flutter app. The code of my entity looks like this. `

@Entity(
  tableName: some_table_name,
  primaryKeys: ['identifier'],
)
class someEntity {
...
  List<String?> someList;

And when I run the generator via flutter packages pub run build_runner build, I get the error:Column type is not supported for List<String?>`

Maybe someone knows how I can resolve this?

1

There are 1 answers

2
Moïse Rajesearison On BEST ANSWER

List<String?> is not yet supported by Floor. But you can declare it in String and when you are going to insert the list in the table, use someList.join(',')