Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

getting index from a map in dart flutter

import 'package:collection/collection.dart';

void main() {
  final fruitList = ['apple', 'orange', 'mango'];
  final withIndices = fruitList.mapIndexed((index, fruit) => "$index - $fruit");
  print(withIndices);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #index #map #dart #flutter
ADD COMMENT
Topic
Name
4+7 =