1

I'd like know , isn't possible to select just one row from database using Flutter and Sqlite ?

I have tried this code :

// db.dart
Future<dynamic> find(Note note) async {
   await openDb();
   return await _database.query('note', where: "id = ?", whereArgs: [note.id], limit: 1);
}

// detail.dart
// note is an object
final noteO = dbmanager.find(note);
print(noteO);

the output of print(noteO) in console is :

I/flutter ( 8845): Instance of 'Future<dynamic>'

1 Answer 1

2

The final noteO = dbmanager.find(note); give you a Future<dynamic>.

If you want to get the result of your query, you need to put the await keyword :

final noteO = await dbmanager.find(note);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.