SortField constructor Null safety

SortField(
  1. [String? name,
  2. bool ascending = true]
)

Creates a new instance and assigns its values.

  • name the name of the field to sort by.
  • ascending true to sort in ascending order, and false to sort in descending order.