LocalDatabaseService class

This class provides the access and management tools for the app's Local SQL Database - provided by sqflite package. Interaction is done using SQL queries which are built similarly to normal SQL statements

Inheritance

Constructors

LocalDatabaseService()
Constructor

Properties

columnAmount String
final
columnDateString String
final
columnDonationProcessed String
final
columnId String
final
db Database
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
hasListeners bool
Whether any listeners are currently registered. [...]
@protected, read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
tableTrackedDonations String
Set the table and column values for the database
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes. [...]
inherited
close() Future
Closes the database connection
delete(int id) Future<int>
Deletes a particular Tracked Donation from the database
deleteDatabase() Future<void>
Delete the tracked donations database
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener and removeListener will throw after the object is disposed). [...]
@mustCallSuper, inherited
getAllNotDroppedOffTrackedDonationsRecentFirst() Future<List<TrackedDonation>>
Retrieves a list of tracked donations that have not yet been dropped off, ordered by date recorded.
getAllTrackedDonationsForAmountGraph() Future<List<GraphAmountDataPoint>>
Retrieve all tracked donations and convert them to a list of GraphAmountDataPoint objects. These will be used to plot the donation data on the donation graph
getAllTrackedDonationsForFeedGraph() Future<List<GraphFeedsDataPoint>>
Retrieves all tracked donations and convert them to a list of GraphFeedsDataPoint objects. These will be used to plot the donation data on the feeds graph
getAllTrackedDonationsRecentFirst() Future<List<TrackedDonation>>
Retrieves a list of tracked donations from the database, ordered by date recorded.
getTotalDonatedAmount() Future<int>
Retrieves the total amount of donated milk
getTrackedDonation(int id) Future<TrackedDonation>
retrieve a particular tracked donation with the specified ID
insert(TrackedDonation trackedDonation) Future<TrackedDonation>
Write a tracked donation to the database
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
notifyListeners() → void
Call all the registered listeners. [...]
openMMDatabase() Future
Open the database. If the database does not yet exist, then create the database and execute the SQL command to generate the table
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes. [...]
inherited
toString() String
Returns a string representation of this object.
inherited
update(TrackedDonation trackedDonation) Future<int>
Retrieves a list of tracked donations from the database, ordered by date recorded.

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited