Flutter/Dart global List variable changed in a foreach loop is unchanged after the loop

I have a list declared outside a for loop and then I assign some values to this list inside that for loop and its value is updated when printed inside the loop but whe...

who to iterate mixed List and Map and object in dart and flutter

how can i iterate bello list and show it in my structure? <pre><code>List courses = [ {'course 1':{'p':['course 0'],'need':[],'v':3}}, {'course 2':{'p':[],'nee...

Looping in Flutter inside ListView

In my app I have a list view with checkboxes. My code: <pre><code> body: Column(children: [ Expanded( child: MasonryGridView.count(...

Loop unknown depth multidimensional array in flutter from JSON

I have an array and this array i get from JSON, but this array is not known how deep and i just want to make it 2 dimensions parrent and children. I make the example j...

How would I put a pause in a .forEach interation

I am attempting to put in a pause between a forEach loop for a list. I would have thought the timeout would cause a pause for the loop but it just seems to sta...

Get iteration index from List.map()

I wrote an iteration on list of letters and put inside cards on screen using map class. In the code you can see that I made a row, and using m...

Use while loop to repeat 3 widgets. in flutter

I want to repeat the following code with index values from 1 to n. How to do it in flutter ? <pre><code>return ListView( children: &lt;Widget&gt;[ SizedBox(...

Flutter Firebase Pagination - Nested Query

I am relatively new to the Flutter world and need some help in efficiently querying a nested Firebase query with pagination in Flutter. I am building an app whe...

Need for looping into DropdownSearch in Flutter

Please I need help for looping <strong>years</strong> in this widget DropdownSearch. I'm using this script, but return with wrong Values. <pre><code>DropdownSearc...

How to play Background Music on loop in a game with Flutter?

Coding a game on Flutter, Want to play music on loop in Background when the app starts with audioplayers: ^0.20.1 package and WidgetsBindingObserver, doesn't work! The...

Nested for loop isnt working as expected in Flutter

Within a Stream Builder I have 2 for loops, the first for loop iterates through all the documents, within each document there is an array and each array element holds...

How to Use Download Functionality in a while Loop?

I have below code, the objective is to put a download button below each image and download that particular image on being clicked. however when I run the code, for all...

How can i loop through an array of objects in flutter

Here is my code <pre><code>Future ppp() async { var url ='my url here'; final response = await http.get(Uri.parse(url)); return response; } var da...

The method was called on null even though method was already declared

I was making an app and it keeps showing an error the method was called on null. When I looked up for answers it was specified that this occurs when method is not decl...

How do I access to a variable outside of loop in dart?

I programmed a little TicTacToe AI in which I declare the 'bestMove' inside the loop, but can't access it outside of it. <pre><code>void computerMove() { int...