Check out example codes for "sort list dart". It will help you in understanding the concepts better.

Code Example 1

List<int> nums = [13, 2, -11];
nums.sort();
print(nums);  // [-11, 2, 13]

Learn ReactJs, React Native from akashmittal.com