Dexcom class
Main class that controls all of the functions.
onStatusUpdate is called when something happens. It's called when we start fetching the account ID, when we finish fetching the account ID, we start fetching the session ID, when we finish fetching the session ID, we start fetching glucose readings, and when we finish fetching glucose readings. status represents the operation being referenced, and finished is false when the operation starts, and true when the operation ends. (Note that this meansonStatusUpdate is called again when the operation finishes.)
onAccountIdUpdate is called only when a new account ID is received, or the account ID is reset. The account ID is never reset automatically. onAccountIdUpdate is also not called when this object is initialized.
Constructors
- Dexcom({String? username, String? password, bool debug = false, int minutes = 60, int maxCount = 12, String? accountId = null, DexcomGlucoseUnit unit = DexcomGlucoseUnit.mgdL, DexcomRegion? region, DexcomAppIds? appIds, void onStatusUpdate(DexcomUpdateStatus status, bool finished)?, void onAccountIdUpdate(String? id)?})
- Makes a Dexcom with the username, password, and region (optional).
Properties
- accountId ↔ String?
-
Account ID for the account using username and password.
getter/setter pair
- appIds → DexcomAppIds
-
Application IDs to be used.
no setter
- debug → bool
-
Debug mode (shows extra logging).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxCount → int
-
Default maximum amount of glucose readings that can be fetched.
final
- minutes → int
-
Default amount of minutes fetched (from now).
final
- password → String?
-
Password used to login to the Dexcom Share API.
final
- region → DexcomRegion
-
Region used to decide which server and app ID to use.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unit → DexcomGlucoseUnit
-
The unit used for reading values.
final
- username → String?
-
Username used to login to the Dexcom Share API; can be email, username, or phone number.
final
Methods
-
getGlucoseReadings(
{int? minutes, int? maxCount, bool allowRetrySession = true}) → Future< List< DexcomReading> ?> - Gets glucose readings using minutes and maxCount.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resetAccountId(
) → void - Set accountId to null.
-
toString(
{bool showPassword = false}) → String -
Converts the current Dexcom object to a string.
Does not show the password of the object by default.
override
-
verify(
) → Future< DexcomVerificationResult> - Verifies that the user has the correct username and password by creating a session to confirm that the user used valid credentials.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
setLoggerCallback(
void callback(String)) → void - Set the logging function used for debug logs.