Add comma separated value to class list

前端 未结 2 1659
时光取名叫无心
时光取名叫无心 2021-01-22 19:40

I need to add the value in the list which is comma separated.

Sample data:

English,Hindi,French

Below is the class of List:



        
2条回答
  •  野的像风
    2021-01-22 20:16

    Dart has a very good type checking system and I think your problem is an obvious one based on the error message. You must convert your list of String into a list of Language. I don't recall the syntax from the top of my head but I think you should be able to convert your list of String with .map>((item) => Language(item))

提交回复
热议问题