'Hi.. I am making a game where I want to show top 5 score like shown in image but if I don't have 5 records in list..it show 'empty'

like

Statstics

  1. David 430
  2. Ellen 300
  3. empty
  4. empty
  5. empty


Solution 1:[1]

You can create a local database using sqlflite package and store data in it.

The link of the package: https://pub.dev/packages/sqflite

It requires you know about databases and sql to be able to store data and keep the top 5 scores only in the data

but it will do the job for you.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yasser Emam