changeStateParams method

  1. @override
Future<bool?> changeStateParams(
  1. SetStateParams params
)
override

Implementation of the method changeStateParams using the PlatformChannel.

Implementation

@override
Future<bool?> changeStateParams(SetStateParams params) async {
  try {
    final state = await methodChannel.invokeMethod<bool>(
        'setState', jsonEncode(params.toJson()));

    return state;
  } on Exception catch (e) {
    throw ConnectionException(message: e.toString());
  }
}