【问题标题】:How to reverse a List of type DataRow?如何反转 DataRow 类型的列表?
【发布时间】:2022-11-10 05:17:05
【问题描述】:

我需要在 DataTable 中使用 List<DataRow>。如果要反转列表,则会产生错误:

The following _TypeError was thrown building Example(dirty):
type 'ReversedListIterable<DataRow>' is not a subtype of type 'List<DataRow>'

如何反转DataRow 类型的列表?

【问题讨论】:

    标签: flutter dart


    【解决方案1】:
    List<DataRow> listOfItems = [......];
    List<DataRow> reversedListOfItems = listOfItems.reversed.toList()
    

    这应该可以解决问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-25
      • 1970-01-01
      相关资源
      最近更新 更多