Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Flutter_client_php_backend | 125 | 3 years ago | apache-2.0 | Dart | ||||||
Sample app demonstrating usage of Flutter Framework to Create Android & IOS App Using Rest API Created In PHP | ||||||||||
Contacts | 116 | 8 months ago | apache-2.0 | Dart | ||||||
A flutter project with Implementation of a Contacts app in 4 ways (API, Custom, Preferences and Sqflite). | ||||||||||
Devwidgets | 87 | 3 months ago | 4 | mit | Dart | |||||
DevWidgets is a Flutter application with several tools such as generators, formatters and converters for developers. It's directly inspired by DevToys. | ||||||||||
Tinano | 61 | 1 | 4 years ago | 3 | March 09, 2019 | other | Dart | |||
A typesafe sqlite persistence library for flutter | ||||||||||
Sqlbrite | 23 | 2 months ago | 10 | September 22, 2021 | 7 | mit | Dart | |||
🌼 RxDart Reactive stream sqflite(sqlite) for Flutter - Sqlbrite for flutter - A lightweight wrapper around sqflite which introduces reactive stream semantics to SQL operations. https://pub.dev/packages/sqlbrite | ||||||||||
Flutter_orm_demo | 23 | 3 years ago | 6 | Dart | ||||||
demo of flutter_orm_plugin | ||||||||||
Flutter_video_player | 20 | 11 days ago | Dart | |||||||
一款完整的视频播放APP,仿抖音页面,横竖屏播放,切换视频,瀑布流页面,筛选功能等,更多等你去发现 | ||||||||||
Easiestdbflutter | 16 | 3 years ago | 11 | July 16, 2020 | n,ull | mit | Dart | |||
The Easiest and the Laziest approach to Flutter SQL Database. | ||||||||||
Allsql | 13 | 2 years ago | 10 | mit | Dart | |||||
AllSQL is an open-source compact browser based SQL Compiler, built using Flutter. | ||||||||||
Saloon Manager Flutter Dotnetcore | 4 | 2 years ago | n,ull | HTML | ||||||
A Saloon Manager Admin Application for SPA's, Saloons, Barber Shop ,Beauty Parlours built using Blazor,DotNetCore,SignalR,SQLServer,Flutter,Firebase,SMS,Whatsapp,Stripe |
sqflite
for Flutter inspired by sqlbrite
pubspec.yaml
dependencies:
...
sqlbrite: <latest_version>
$ flutter packages get
import 'package:sqlbrite/sqlbrite.dart';
BriteDatabase
:final Database db = await openDb();
final briteDb = BriteDatabase(db);
final briteDb = BriteDatabase(db, logger: null); // disable logging.
BriteDatabase.createQuery
method is similar to Database.query
. Listen to the returned Stream<Query>
which will immediately notify with a Query
to run.BriteDatabase
.class Entity {
factory Entity.fromJson(Map<String, dynamic> map) { ... }
factory Entity.empty() { ... }
Map<String, dynamic> toJson() { ... }
}
mapToOne
extension method on Stream<Query>
// Emits a single row, emit error if the row doesn't exist or more than 1 row in result set.
final Stream<Entity> singleQuery$ = briteDb.createQuery(
'table',
where: 'id = ?',
whereArgs: [id],
limit: 1,
).mapToOne((row) => Entity.fromJson(row));
mapToOneOrDefault
extension method on Stream<Query>
// Emits a single row, or the given default value if the row doesn't exist, or emit error if more than 1 row in result set
final Stream<Entity> singleOrDefaultQuery$ = briteDb.createQuery(
'table',
where: 'id = ?',
whereArgs: [id],
limit: 1,
).mapToOneOrDefault(
(row) => Entity.fromJson(row),
defaultValue: Entity.empty()
);
mapToList
extension method on Stream<Query>
// Emits a list of rows.
final Stream<List<Entity>> listQuery$ = briteDb.createQuery(
'table',
where: 'name LIKE ?',
whereArgs: [queryName],
).mapToList((row) => Entity.fromJson(row));
Database
// will trigger query stream again
briteDb.insert(
'table',
Entity(...).toJson()
);
// will trigger query stream again
briteDb.update(
'table',
Entity(...).toJson(),
where: 'id = ?',
whereArgs: [id],
);
// will trigger query stream again
briteDb.update(
'table',
where: 'id = ?',
whereArgs: [id],
);
RxDart
operatorsbriteDb
.createQuery(
'table',
where: 'name LIKE ?',
whereArgs: [queryName],
)
.debounceTime(const Duration(milliseconds: 500))
.where(filterQuery) // query is lazy, this lets you not even execute it if you don't need to
.mapToList((row) => Entity.fromJson(row))
.listen(updateUI);
SQL Brite's only responsibility is to be a mechanism for coordinating and composing the notification of updates to tables such that you can update queries as soon as data changes.
This library is not an ORM. It is not a type-safe query mechanism. It's not going to perform database migrations for you.
MIT License
Copyright (c) 2019 - 2022 Petrus Nguyễn Thái Học