by @kodeazy
flutter how to Sort List of Strings in dart file?
- we use
sort()
function to Sort list of Strings in dart . -
Below is an example of how to sort list of strings in dart.
void main() { List cars = ['Mercedes-Benz', 'skoda', 'BMW']; print(cars..sort()); }
Output:
[BMW, Mercedes-Benz, skoda]