1) .any
This is a list of Languages
And you can use the .any
to check whether any elements of this iterable to satisfy the test.
In this example we verify if any language starts with the letter D or B
The first one is true and the second one is false.
2) .padRight .padLeft
You can add characters before or after a string if you use the padLeft or padRight.
This number is the total amount of character you will have and
This is what will be added inside your string
You can do the same thing with the padRight.
3) .shuffle()
It is sometimes useful to randomize items inside the list
For this you can use the shuffle and you can see that everything is now randomized.
4) String Multiplication
It is possible to use string multiplication with dart.
This example will print x times your string.
5) .toSet()
If you have a list of repeated items.
You can use the .toSet()
to remove all the duplicates and this is the final result.
Top comments (0)