Sometimes, when backend is not ready, you want to test your app which using ListView or GridView. In such case, you can generate random data using flutter inbuilt List generation function.

In this screenshot you are seeing that we generate some random users with radom offline and online status. Will you believe that this data is generated using just single line of code. So lets start.
Just generate the random data using the following code.
Syntax
The below code returns a dynamic value. you can return any data type.
List.generate(length, (index) => returnSomeValue);
Or you can also explicit give your data type. I’ve given String and it should also return a String.
List
Now lets dive on the code part.
List<Map> generatedList = List<Map>.generate(
20, (i) => {'username': 'john$i', 'email': 'john$i@example.com', "mobiles": List<String>.generate(2, (index) => "9999${Random().nextInt(1000000)}"),"isOnline": Random().nextBool()});
In this code, I’ve created a List<Map> which i can use to create a list of yours.
Now you can use generatedList variable to your ListView.