How do I combine two lists in Dart?

前端 未结 8 746
有刺的猬
有刺的猬 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:28

    Dart now supports concatenation of lists using the + operator.

    Example:

    List result = [0, 1, 2] + [3, 4, 5];
    

提交回复
热议问题