5 Flutter Dart Tips.

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 secon…


This content originally appeared on DEV Community and was authored by Dreamy Developer

1) .any

This is a list of Languages

.any

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.

result

2) .padRight .padLeft

You can add characters before or after a string if you use the padLeft or padRight.

padleft

This number is the total amount of character you will have and

total

This is what will be added inside your string

string

You can do the same thing with the padRight.

3) .shuffle()

It is sometimes useful to randomize items inside the list

shuffle

For this you can use the shuffle and you can see that everything is now randomized.
ran

4) String Multiplication

It is possible to use string multiplication with dart.

This example will print x times your string.
String Multiplication

5) .toSet()

If you have a list of repeated items.

toset

You can use the .toSet() to remove all the duplicates and this is the final result.

res


This content originally appeared on DEV Community and was authored by Dreamy Developer


Print Share Comment Cite Upload Translate Updates
APA

Dreamy Developer | Sciencx (2022-07-27T16:56:32+00:00) 5 Flutter Dart Tips.. Retrieved from https://www.scien.cx/2022/07/27/5-flutter-dart-tips/

MLA
" » 5 Flutter Dart Tips.." Dreamy Developer | Sciencx - Wednesday July 27, 2022, https://www.scien.cx/2022/07/27/5-flutter-dart-tips/
HARVARD
Dreamy Developer | Sciencx Wednesday July 27, 2022 » 5 Flutter Dart Tips.., viewed ,<https://www.scien.cx/2022/07/27/5-flutter-dart-tips/>
VANCOUVER
Dreamy Developer | Sciencx - » 5 Flutter Dart Tips.. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/07/27/5-flutter-dart-tips/
CHICAGO
" » 5 Flutter Dart Tips.." Dreamy Developer | Sciencx - Accessed . https://www.scien.cx/2022/07/27/5-flutter-dart-tips/
IEEE
" » 5 Flutter Dart Tips.." Dreamy Developer | Sciencx [Online]. Available: https://www.scien.cx/2022/07/27/5-flutter-dart-tips/. [Accessed: ]
rf:citation
» 5 Flutter Dart Tips. | Dreamy Developer | Sciencx | https://www.scien.cx/2022/07/27/5-flutter-dart-tips/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.