final notes = <String>['do', 're', 'mi', 're'];
final index = notes.indexOf('fa'); // -1
Reference
https://api.dart.dev/stable/2.16.1/dart-core/List/indexOf.html
indexOf method - List class - dart:core library - Dart API
int indexOf(E element, [int start = 0] ) The first index of element in this list. Searches the list from index start to the end of the list. The first time an object o is encountered so that o == element, the index of o is returned. final notes = ['do', 'r
api.dart.dev
728x90
'Flutter' 카테고리의 다른 글
[Flutter] Textfield 속성 (0) | 2022.04.28 |
---|---|
[Flutter] flutter remove textfield underline (0) | 2022.04.28 |
[Flutter] How can i get int data from TextEditingController in flutter (0) | 2022.04.27 |
[Flutter] How to convert List to String without [] (0) | 2022.04.27 |
[Flutter] flutter multiple api calls ; 여러개의 response 처리하기 (0) | 2022.04.27 |