There are a number of things wrong. 1. The nombreElementsPairs function is inside the main function; it should be a separate block. 2. The list of numbers is supposed to be a parameter passed in to the function, but you ignore that and create a new local list. 3. You create the counter nombreElementsPairs but never refer to it again. 4. You test every element of the list to see if it is even, and if it is you set the resultat variable to zero. Note, that you previously initialised resultat to zero, so if all elements of the list are odd, it will still be zero at the end. 5. The return value of the function is resultat which will always be zero, which is not the count of anything. 6. The print statement does nothing useful. As I already suggested, you should go to the Dart website and work through the tutorials, so you get to understand how to structure your program logically.