getMeasurement method
Collects the Measurement. Implemented by subclasses.
Can return null if no data is available.
Can return an Error measurement if an error occurs.
Implementation
@override
Future<Measurement> getMeasurement() async {
List<SmsMessage> allSms = [];
allSms
..addAll(await _telephony.getInboxSms(columns: ALL_SMS_COLUMNS))
..addAll(await _telephony.getSentSms(columns: ALL_SMS_COLUMNS));
return Measurement.fromData(TextMessageLog(allSms.map((sms) => TextMessage.fromSmsMessage(sms)).toList()));
}