addCycleFace method
void
addCycleFace(
- int startTime,
- int endTime,
- CommandRepeatArray repeat,
- BleDeviceCall<
String> call, { - String? nickname,
override
Implementation
@override
void addCycleFace(int startTime, int endTime, CommandRepeatArray repeat,
BleDeviceCall<String> call,
{String? nickname}) {
_channel.setMethodCallHandler(null);
_channel.setMethodCallHandler((channelCall) {
if (channelCall.method == "addCycleFaceProgress") {
if (call.faceProgress != null) {
call.faceProgress!(
channelCall.arguments["overall"],
channelCall.arguments["current"],
FaceActionList.fruitFromString(channelCall.arguments["action"]));
}
}
return Future.value(null);
});
_channel.invokeMethod<String>("addCycleFace", {
"startTime": startTime,
"endTime": endTime,
"repeat": json.encode(repeat.toMap()),
"nickname": nickname
}).then((uid) {
_channel.setMethodCallHandler(null);
call.success(uid!);
}).onError((PlatformException error, stackTrace) {
_channel.setMethodCallHandler(null);
call.fail(error);
});
}