dexcom 1.0.1
dexcom: ^1.0.1 copied to clipboard
dexcom for Dart allows you to use Dexcom Share to get your Dexcom CGM data, or anybody else's, to run your application.
import 'package:dexcom/dexcom.dart';
void main({String username = "", String password = ""}) async {
Dexcom dexcom = Dexcom(username: username, password: password, debug: false);
DexcomStreamProvider provider = DexcomStreamProvider(
dexcom,
debug: true,
buffer: 10,
);
print("Dexcom: $dexcom");
print("Provider: $provider");
print("Dexcom readings: ${await dexcom.getGlucoseReadings(maxCount: 3)}");
print("Dexcom verify: ${await dexcom.verify()}");
provider.listen(
onData: (data) => print('Stream received: $data'),
onError: (error) => print('Stream errored: $error'),
onTimerChange: (time) {
print("Stream timer: $time");
},
);
}