Techiio-author
Started by Bruce MccullamOct 6, 2021

Open
Displaying data from sqlite database in Flutter

1 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 1 VIEWES SHARE

I am currently working on my first Flutter-App and I have the following problem: I can't display any data from the sqlite db on the screen. The data is stored in the database - I can print it in the console, but I don't manage to display it on the screen. In the tutorials I watched, they always used the ListView.builder. However I only want to display one specific name from a certain id - and not the whole db content.

  • Are there other ways to display data from the sqlite database in flutter then ListView?
  • Can I use ListView to only show a specific dataset (where id =...)? If so, could you give me an example? Everything I've tried didn't work.
  • Can you recommend any good tutorials/ articels on this matter?

I'm grateful for every advice you might have concerning this problem!

1 Replies

Techiio-commentatorDebarghya Das replied 3 months ago0 likes0 dislikes

Use FutureBuilder and in the future, pass the functions to fetch a specific row from dao, the results will be observed on a snapshot where you can display the data.

Here is the example I've done, Hope it would help you

body: StreamBuilder<ChatHistorie>(
          stream: model.getHistory(_historyId),
          builder: (context, snapShot) {
            if (snapShot.hasData && snapShot.data!= null)
               return Text(data.message);
            else
                return Center(child: Text("No data found"));
          }
        )
You must be Logged in to reply
Trending Technologies
15
Software40
DevOps47
Frontend Development24
Backend Development20
Server Administration17
Linux Administration26
Data Center24
Sentry24
Terraform23
Ansible83
Docker70
Penetration Testing16
Kubernetes21
NGINX20
JenkinsX17
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance