Questions tagged [sqflite]

Use this tag for questions about the plugin for flutter named sqflite - which enables storage, retrieval, and manipulation of SQLite databases via flutter code.

sqflite is an plugin for . Supports both and .

Package documentation: sqflite

902 questions
3
votes
1 answer

Typeconverter for list of objects in Floor ORM

Is there any way to use typeconverter for list of objects in floor database, like we have in room database for android. For example i have entity class which has field list of objects; @Entity(tableName: "example") class Example { @PrimaryKey() …
3
votes
1 answer

How to get individual column value from sqflite database flutter

// THis is model>> class CompanyProfile { // to create name tag for database static const String columnId = '_id'; static const String comapnyNametag = 'CompanyName'; static const String phoneNumbertag = 'PhoneNumber'; …
smile675
  • 41
  • 3
3
votes
1 answer

How to set up sqlite database in flutter with null safety?

I've been struggling for a while to set up a sqlite database with sqflite in flutter. Code is producing a new instance of the database every time I call the getter method for a database. Here is the code: class DatabaseProvider { …
Mayketi
  • 93
  • 11
3
votes
0 answers

near "Column": syntax error. problem when rename or drop column in sqflite flutter

tables db.("CREATE TABLE if NOT EXISTS ayet ( id INTEGER, User_Name INTEGER DEFAULT(0),PRIMARY KEY(id AUTOINCREMENT))"); db.("CREATE TABLE if NOT EXISTS sure ( id INTEGER, User_Name INTEGER DEFAULT(0),PRIMARY KEY(id AUTOINCREMENT))"); when i…
3
votes
1 answer

Flutter: Unhandled Exception: Null check operator used on a null value

I am practicing with SQFLite database in flutter App. I want to create a database where user can add friend's name and mobile number. And after adding this information, that information list will be shown under submit button [ where I using…
Abir Ahsan
  • 2,649
  • 29
  • 51
3
votes
1 answer

What is the difference between path and path_provider?

I'm currently using the path_provider package for the initialisation of Hive in my main.dart: final appDocumentDirectory = await pathProvider.getApplicationDocumentsDirectory(); Hive.init(appDocumentDirectory.path); I want to embed a local database…
Nuqo
  • 3,793
  • 1
  • 25
  • 37
3
votes
2 answers

flutter sqlite database storage location

I want to have an SQLite db in my flutter app, so i followed this flutter cookbook: https://flutter.dev/docs/cookbook/persistence/sqlite I open the database with the following path: join(await getDatabasesPath(), 'doggie_database.db') exactly like…
Ole
  • 122
  • 1
  • 8
3
votes
0 answers

What is the best way to store image in device using Flutter

I was trying to save gallery image file using image picker. I don't know it's not saving in directory. So I decided to store it in database. How to store image in sqlite database? Image storing as String or Blob or any other type which is better…
Athira Reddy
  • 1,004
  • 14
  • 18
3
votes
1 answer

Flutter ListView won't Update

I am new to Flutter development. I just started to make Note app with Provider pattern, but when I update note, It won't update and It just create a new note in list. But when I minimize and return back list is updated. when I click on the item, it…
Athira Reddy
  • 1,004
  • 14
  • 18
3
votes
1 answer

flutter: Warning database has been locked for 0:00:10.000000. on Android

I stuck at this error for a month I cannot find any solution via google. I build a chat app which need to work both online and offline, backend is NodeJS Below code is send any message that still in pending to target devices async function…
CeebLaj Thoj
  • 81
  • 2
  • 10
3
votes
3 answers

Error database_closed when using flutter's sqflite

I try to use sqflite to save some data like my class Movie but when i try to insert or query on the database, see this message: [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: DatabaseException(error database_closed) my MovieBloc…
Mohammad Shamsi
  • 521
  • 4
  • 11
3
votes
1 answer

Sqflite or Shared Preference, which is suitable for storing user data locally in flutter?

So I am working on an app that will allow the users to create an account offline with some basic information such as name, designation etc. And I want the user to be able to use the app completely in offline. But also I want to keep an option to…
hasib_ullah
  • 180
  • 1
  • 15
3
votes
1 answer

How to store a list of objects in sqflite?

I want to use the sqflite package to store my objects. I read some articles, tutorials and examples about it. So far I understand everything. But none of them covers my use case: I have a class named Foo. This class holds beside some primitive…
0x4b50
  • 629
  • 6
  • 18
3
votes
1 answer

Future to List with Objects in Flutter

I recently started with Flutter. My App runs a sqflite database and I want to get all the data out of it and show it in a Row Widget in my App. I know how to get the data and I know how to build the Widgets. I´m so confused, I have no idea how to…
mariusEBR
  • 43
  • 1
  • 2
  • 5
3
votes
1 answer

OnTap Function in the DropDownMenu Button in Flutter

I've tried to populate the dropdown menu button with the data from the SQLite database. Then on the onTap Function I wanted to navigate to the selected category. When I tap on the category it does not navigate. I have saved each category with an id…