sqflite_helper_new 1.0.0
sqflite_helper_new: ^1.0.0 copied to clipboard
The sqflite_helper package provides a helper class for sqflite, which is a Flutter plugin for SQLite, a self-contained, high-reliability, embedded, SQL database engine, and can be used to persist data [...]
This Package will make using sqflite much more fun and much easy than making it from zero
Features #
It will help you to create the crude of the sqflite by just calling all the methods like createdatabase, update, delete, insert and get the data from the database
Getting started #
dependencies: sqflite_helper_new: ^1.0.0 or
write in the terminal flutter pub add sqflite_helper_new
Usage #
First create a variable
final sqfliteHelper = SqflitehelperNew();
add the createdatabase inside the initialestate
Example of creating the database:
sqfliteHelper.createDatabase(
version: 1,
databasefilename: 'todo.db',
tablename: 'tasks',
columns: [
{
'name': 'id',
'type': 'INTEGER PRIMARY KEY AUTOINCREMENT',
},
{
'name': 'title',
'type': 'TEXT',
},
{
'name': 'description',
'type': 'TEXT',
},
{
'name': 'status',
'type': 'TEXT',
},
]);
Example of the insert:
sqfliteHelper.insert(
tablename: 'tasks',
data: {
'title': titlecontroller.text,
'description': descriptioncontroller.text,
'status': 'new',
},
);
Example of the get data from the database with the column name selected by the developer:
sqfliteHelper.getdatafromdatabase(
tablename: 'tasks', columnname: 'title');
without the column name selected by the developer:
sqfliteHelper.getdatafromdatabase(
tablename: 'tasks');
Example of the update the data:
sqfliteHelper.updateRecord(
tablename: 'tasks',
newData: {"title": "ert"},
whereColumn: "title",
oldValue: "xx");
Example of the delete:
sqfliteHelper.deleteFromDatabase(tablename: 'tasks', whereColumn: 'title', value: 'ert');
const like = 'sample';
Additional information #
This package will be opensourse and it will be always up to date with sqflite and the sqflite_comman_ffi packages also this package can be updated to use much more features