SimpleDatabase class
Constructors
-
SimpleDatabase({required String name, dynamic fromJson(Map<
String, dynamic> )?}) - Requires a name and an optional function used to rebuild from json
Properties
-
fromJson
→ (dynamic Function(Map<
String, dynamic> )?) -
Optional function used to rebuild user defined objects
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The name of the file for localstorage
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
dynamic object) → Future< void> - Add an object into the database
-
addAll(
List list) → Future< void> - Add a list of objects into the database
-
clear(
) → Future< void> - Delete all objects from the database
-
contains(
dynamic object) → Future< bool> - Bool if the database contains an object
-
count(
) → Future< int> - The amount of items in the database
-
getAll(
) → Future< List> - A list of dynamic which contains all objects in the database
-
getAllType<
T> () → Future< List< T> > -
getAt(
int index) → Future - The object stored at an idex
-
getAtType<
T> (int index) → Future< T> -
insert(
dynamic object, int index) → Future< void> - Insert object at an index
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
dynamic object) → Future< bool> - Delete the first instance of an object
-
removeAt(
int index) → Future< void> - Delete an object at an index
-
saveList(
List list) → Future< void> - Overrite the current data with the passed list
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited