How do I combine two lists in Dart?

前端 未结 8 748
有刺的猬
有刺的猬 2021-01-31 00:46

I was wondering if there was an easy way to concatenate two lists in dart to create a brand new list object. I couldn\'t find anything and something like this:

My list:

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-31 01:42

    maybe more consistent~

    var list = []..addAll(list1)..addAll(list2);
    

提交回复
热议问题