flutterfloorflutter-floor

Floor. Column type is not supported for List<>


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?


Solution

  • 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(',')