Home > database >  How to reverse a List of type DataRow?
How to reverse a List of type DataRow?

Time:10-29

There is a List<DataRow> which I need to use in DataTable. If to reverse the list it produces the error:

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

How to reverse a List of type DataRow?

CodePudding user response:

List<DataRow> listOfItems = [......];
List<DataRow> reversedListOfItems = listOfItems.reversed.toList()

this should do the trick

  • Related