clearAids static method
Implementation
static Future<void> clearAids() async {
/// Stream method
final stream = FlutterNewposSdk._methodStream.stream
.where((m) => m.method == 'OnClearAids')
.map((m) {
return m.arguments as bool;
});
try {
final methodResult = await _invokeMethod(
'clearAids',
);
final result = methodResult as bool;
if (!result) {
throw const FlutterPosException(
code: 'CLEAR_AIDS_FAILURE',
message: 'Exception clearing aids',
);
}
final streamOutput = await getFirstResultInStream(
stream,
const Duration(seconds: 10),
);
if (streamOutput == false) {
throw const FlutterPosException(
code: 'CLEAR_AIDS_FAILURE',
message: 'Exception clearing aids',
);
}
} on TimeoutException {
throw const FlutterPosException(
code: 'CLEAR_AIDS_TIMEOUT',
message: 'Timeout clearing aids',
);
} catch (e) {
throw const FlutterPosException(
code: 'CLEAR_AIDS_FAILURE',
message: 'Exception clearing aids',
);
}
}