getMindfulnessModeSet method
Retrieves a set of Mindfulness Mode instructions.
May throw a SocketException
when network connectivity issues occur.
May throw a FormatException when invalid data is received.
Implementation
Future<MindfulnessModeSet> getMindfulnessModeSet(
MindfulnessMode mindfulnessMode) async {
final response = jsonDecode(await _makeApiRequest({
'generateFlow': '1',
'sessionID': mindfulnessMode.sessionId,
}));
if (response is! Map<String, dynamic>) {
throw FormatException(
'Could not parse mindfulness mode set JSON!', response);
}
return MindfulnessModeSet.fromJson(response);
}