Last updated:
0 purchases
realm db
Realm DB #
A class to make it easier to use Realm in Flutter.
Under Development.
Currently only available for disconnected mode.
Install Package #
flutter pub add realm_db
copied to clipboard
Initialize
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await DB.instance.init();
runApp(const MyApp());
}
copied to clipboard
Get Data
DB.instance.get<Product>(
query: "",
arguments: [],
) as RealmResults<Product>
copied to clipboard
Get Snapshot
DB.instance.snapshot<Product>(
query: query,
arguments: arguments,
)
copied to clipboard
Create
DB.instance.add<Product>(item)
copied to clipboard
Update
DB.instance.update<Product>(item, (current, item) {
current.productName = item.productName;
current.price = item.price;
})
copied to clipboard
Delete
DB.instance.delete<Product>(item);
copied to clipboard
Delete All
DB.instance.deleteAll<Product>();
copied to clipboard
Auth #
Login
await AuthService.instance.login(
email: "[email protected]",
password: "123456",
);
copied to clipboard
Logout
await AuthService.instance.logout();
copied to clipboard
Check Login Status
await AuthService.instance.isLoggedIn();
copied to clipboard
Register
await AuthService.instance.register(
email: "[email protected]",
password: "123456",
);
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.